2

I have deployed my web application in Apache Tomcat 9.x.x and I have two options for Java

  • Openjdk version 1.8.x
  • Oracle Java 1.8.x

I need to allow TLS 1.2 only.

Please help guide me to achieve this.

I have tried to follow the following links(Not sure if they are outdated).

But https://www.ssllabs.com/ssltest/analyze.html?d=<< my public IP >> says : TLS 1.1 & TLS 1.0 are still enabled.

how to enable TLS v1.2 in Apache tomcat 8 , I am using Java 8

How do I disable SSLv3 in tomcat?

Does Tomcat support TLS v1.2? (The two steps mentioned by oraclesoon doesn't seem to work)

How do I disable SSLv3 support in Apache Tomcat?

Also HOW TO -- Disable weak ciphers in Tomcat 7 & 8 says sslProtocol is no longer used in java 8

lab bhattacharjee
  • 1,617
  • 2
  • 17
  • 33

3 Answers3

2

I use tomcat 9.0.14 and JSSE. it works fine. (using TLSV1.1 and TLSV1.2)

<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true">
    <SSLHostConfig protocols="TLSv1.1,TLSv1.2">     
    <Certificate certificateKeystoreFile="conf/keystore.jks" 
                     type="RSA" />
    </SSLHostConfig>
</Connector>

See: https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#SSL_Support

1

You have to configure the Connector in the $CATALINA_BASE/conf/server.xml file. An example of an APR configuration is:

<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<Connector
           protocol="org.apache.coyote.http11.Http11AprProtocol"
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           SSLCertificateFile="/usr/local/ssl/server.crt"
           SSLCertificateKeyFile="/usr/local/ssl/server.pem"
           SSLVerifyClient="optional" SSLProtocol="TLSv1.2"/>

Please refer this configuration guide and try that out.

Ravindra Ranwala
  • 20,744
  • 6
  • 45
  • 63
0

If you need to check on a request by request basis to ensure that someone hasn't misconfigured your server, you can add a ContainerRequestFilter and then inside the filter(RequestContext requestContext) method insert a check that verifies that the TLS connection adhere's to your requirement.

if("TLSv1.2".equals(requestContext.getProperty("org.apache.tomcat.util.net.secure_protocol_version"))
{
   throw new IllegalStateException("Invalid TLS version");
}

This example is from Tomcat 8, but I suspect an option may be available for other containers.

Bill
  • 1
  • 1