Issue
Is it possible to use SNI in Tomcat 9 without installing the rel="nofollow noreferrer">Tomcat Native Library?
I reviewed the Tomcat 9 configuration documentation and it's not clear if the JSSE Java SSL implementation would be sufficient or if the OpenSSL implementation can be accessed through the existing pure Java code without the native connector.
Thanks.
Update: With Mark Thomas's reassurance, I got the code to work. It's awesome! Thanks Mark! Here is my code in part, hopefully it can help others:
Connector c = tomcat.getConnector();
c.setPort(8443);
c.setAttribute("SSLEnabled", "true");
c.setAttribute("defaultSSLHostConfigName", "www.domain1.com");
SSLHostConfig sslHostConfig1 = new SSLHostConfig();
sslHostConfig1.setHostName("www.domain1.com");
sslHostConfig1.setCertificateFile("/certs/domain1.pem");
c.addSslHostConfig(sslHostConfig1);
SSLHostConfig sslHostConfig2 = new SSLHostConfig();
sslHostConfig2.setHostName("www.domain2.com");
sslHostConfig2.setCertificateFile("/certs/domain2.pem");
c.addSslHostConfig(sslHostConfig2);
SSLHostConfig sslHostConfig3 = new SSLHostConfig();
sslHostConfig3.setHostName("*.domain3.com");
sslHostConfig3.setCertificateFile("/certs/domain3-wildcard.pem");
c.addSslHostConfig(sslHostConfig3);
Solution
The JSSE implementation supports SNI (we had to hand craft it).
If you want to use the OpenSSL implementation, you have to use Tomcat Native.
Answered By - Mark Thomas
Answer Checked By - Gilberto Lyons (JavaFixing Admin)