0
<Connector port=443
           protocol="org.apache.coyote.http11.Http11Nio2Protocol"
           maxThreads="150" SSLEnabled="true"
           sslImplementationName="org.apache.tomcat.util.net.openssl.OpenSSLImplementation">
    <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
    <SSLHostConfig protocols="TLSv1.3" ciphers="TLS_AES_128_GCM_SHA256">
        <Certificate certificateKeyFile="conf/certs/key.pem"
                     certificateFile="conf/certs/cert.pem"
                     type="RSA" />
    </SSLHostConfig>
    </Connector>

Error:

16-Aug-2021 16:50:42.662 WARNING [main] org.apache.tomcat.util.net.openssl.OpenSSLContext.init Error initializing SSL context
        java.lang.Exception: Unable to configure permitted SSL ciphers (error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match)
                at org.apache.tomcat.jni.SSLContext.setCipherSuite(Native Method)
                at org.apache.tomcat.util.net.openssl.OpenSSLContext.init(OpenSSLContext.java:245)
                at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:246)
                at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:97)
                at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71)
                at org.apache.tomcat.util.net.Nio2Endpoint.bind(Nio2Endpoint.java:141)
                at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1208)
                at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1221)
                at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
                at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)
                at org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.core.StandardService.initInternal(StandardService.java:561)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1049)
                at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
                at org.apache.catalina.startup.Catalina.load(Catalina.java:724)
                at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:305)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)

Is the choice of TLS ciphers not yet supported in Tomcat if we use TLSv1.3?

Piotr P. Karwasz
  • 12,857
  • 3
  • 20
  • 43
Anil Kumar
  • 61
  • 1
  • 6
  • Does Tomcat not yet support controlling TLSv1.3 ciphers? – Anil Kumar Aug 16 '21 at 12:21
  • What version of the Apache Tomcat Native Library, APR and OpenSSL are you using? They are logged during server startup. Also what OS are you using? – Piotr P. Karwasz Aug 16 '21 at 20:01
  • 1
    using APR version [1.6.3] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1g FIPS 21 Apr 2020] – Anil Kumar Aug 17 '21 at 11:20

1 Answers1

0

Your hypothesis is partially correct: it is not possible to restrict the TLSv1.3 ciphersuites if you use OpenSSL (cf. discussion on tomcat-users).

OpenSSL uses different functions to set the cipher suites for TLSv1.3 and the previous versions: *_set_ciphersuites for TLSv1.3 and *_set_cipher_list for TLSv1.2 and lower, cf. man page. The Tomcat Native Library only uses the second set of functions (cf. source code).

On the other hand JSSE does not discriminate between TLSv1.2 and TLSv1.3 cipher suites (see JSSE Cipher Suites Names), so your configuration will work if you change SSL implementation:

<Connector port=443
           SSLEnabled="true"
           protocol="org.apache.coyote.http11.Http11Nio2Protocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation">
    <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
    <SSLHostConfig protocols="TLSv1.3" ciphers="TLS_AES_128_GCM_SHA256">
        <Certificate certificateKeyFile="conf/certs/key.pem"
                     certificateFile="conf/certs/cert.pem"
                     type="RSA" />
    </SSLHostConfig>
</Connector>
Piotr P. Karwasz
  • 12,857
  • 3
  • 20
  • 43
  • Thank you for this information and insight, will try it out. – Anil Kumar Aug 18 '21 at 16:57
  • You didn't specify it in your question, but if your goal is performance (and AES128 is the fastest cipher on your machine), then switching to JSSE with AES128 will give your probably a worse performance than OpenSSL with AES256 (especially if you have AES-NI). Cf. [this slideshow](http://events17.linuxfoundation.org/sites/events/files/slides/TomcatOpenSSL.pdf). – Piotr P. Karwasz Aug 18 '21 at 19:40