mozilla / server-side-tls

Server side TLS Tools
https://ssl-config.mozilla.org
Mozilla Public License 2.0
1.12k stars 158 forks source link

Tomcat Intermediate configuration (TLS v1.2 + TLS v1.3) not working correctly #280

Open toby1984 opened 2 years ago

toby1984 commented 2 years ago

At least on my CentOS7 system with JDK16 (OpenJDK, Temurin)

openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment Temurin-16.0.2+7 (build 16.0.2+7)
OpenJDK 64-Bit Server VM Temurin-16.0.2+7 (build 16.0.2+7, mixed mode, sharing)

and Apache Tomcat 9.0.54 (downloaded from tomcat.apache.org) the generated server.xml did not work correctly. I would only ever get TLSv1.2 connections and "openssl s_client -tls1_3 ..." failed.

Enabling SSL debugging on the JVM using -Djavax.net.debug=ssl,handshake printed the following error:

HandshakeContext.java:305|No available cipher suite for TLS13 

I attached a remote debugger to the JVM and stepped through HandshakeContext#getActiveProtocols() and the CipherSuite#supports() calls in

        for (CipherSuite suite : enabledCipherSuites) {
            if (suite.isAvailable() && suite.supports(protocol)) { 

returns FALSE for TLS13 and all cipher suites the SSL configuration generator suggested. To fix this, I had to add the following additional cipher suites to my server.xml:

TLS_AES_128_GCM_SHA256
TLS_AES_256_GCM_SHA384
TLS_CHACHA20_POLY1305_SHA256
janbrasna commented 5 months ago

@toby1984 Do you happen to know if this issue is over APR/OpenSSL or JSSE implementation?

This is somewhat tricky as OpenSSL won't control any TLSv1.3-related configuration via the <SSLHostConfig ciphers/> as it uses different APIs for that; on the other hand JSSE treats them equally so if they're not in the list they won't be used for handshake it seems…