I want to de-activate TLSv1.0 with spring boot(release 1.3.3), but it doesn't work if application.yml as below:
ssl:
protocol: TLSv1.2
key-store: /E:/key/server.jks
key-store-password: serverpkcs12
I still can access web page if only choose "USE TLS 1.0" in IE. See this pic--not work.
However, if doesn't use embedded tomcat, and add these arguments for Connector located in server.xml, it works fine for me--web page blocked by IE. See this pic--worked for me
sslProtocols="TLSv1.2" sslEnabledProtocols="TLSv1.2"
And I also tried some VM arguments, for exmaple -Dhttps.protocols="TLSv1.2", all of them are useless.
So What can I do for this?
The most transparent and readable way is to explicitly configure the valid TLS protocols in your application configuration file by excluding - of course - the unwanted ones.
e.g. in YAML
You can then start your server and check whether TLSv1.0 is working by peforming the following
The above connections should be rejected whereas the following two will be accepted and print the certificate's details
My solution is
And remove protocol: TLSv1.2 from application.yml
A way that i found is to set ciphers that are supported only by TLSv1.2. Ex: If you will put in application.yml
And the using CURL
You will see that request will be ignored / rejected because that cipher that you set in application.yml will validate only TLSv1.2 requests.
The answers so far only show how to lock-down TLS to a set of versions not yet considered broken. Since the question was how to de-activate a specific version, here's how using at least java 8:
Do this early on in your context initialisation before the Tomcat server is created and to be thorough you should catch
SecurityException
in case there's a policy in place that blocks thesetProperty()
call.Using this method you benefit from new versions included in the JDK in the future.