Apologies if this question has already been addressed. I've found many related issues like this one:
but none have answered my question. They all seem to relate to issues that should now be fixed in my Java 11 version or related to TLSv1.0/v1.1 which I'm not using.
I've not tagged this question as relating to Grails as I don't believe the Grails framework is the issue here.
Anyway, I've inherited an old Grails 2 app that I'm currently upgrading to Grails 5. I currently have both deployed alongside eachother on a test server and deployed on Tomcat 9. The Grails 2 version is built using Oracle JDK 1.8.0.221 and the Grails 5 app built using Termurin JDK 11.0.13.
In order to get the new Grails 5 app running on Tomcat 9 I needed to set Tomcat 9's JAVA_HOME to Java 11 as well via a file:
tomcat/bin/setenv.sh
These apps send email notifications to users via SendGrid.
However when I force Tomcat to use Java 11 the emails sent through SendGrid in the old Grails 2 application fail due to:
SSLHandshakeException:
No appropriate protocol (protocol is disabled or cipher suite is inappropriate)
I tried playing with the TLS versions and cipher suites enforced by the Grails 2 app, as they were set as follows during startup:
System.setProperty("https.protocols","TLSv1.2")
System.properties['jdk.tls.client.protocols'] = 'TLSv1.2'
System.properties['https.cipherSuites'] = 'TLS_DHE_RSA_WITH_AES_256_GCM_SHA384'
But had no luck getting these emails to SendGrid working in the old Grails 2 app when Tomcat was set to use JDK11. I don't think the TLSv1.2 is the issue as that should still be widely supported, but I wasn't able to overcome this issue by changing cipher suites or disabling these instructions completely either.
The issue seems to be solely related to forcing Tomcat 9 to use JDK 11, which I need for my Grails 5 upgrade.
I need to support the old Grails 2 app for a while until the Grails 5 version is production ready, and I'd prefer not to run two separate Tomcat instances using two different Java versions just for this one SSL issue.
Is this a known issue with Java 11 and/or Tomcat 9 and if so is there a workaround? Is this perhaps related to the fact that my Java 8 JDK is an Oracle distribution and my Java 11 one is OpenJDK/Temurin?