Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will SSLContext.getInstance("TLS") supports TLS v1.1 and TLS v1.2 also?

In my java Code i am creating one instance of SSL Context using command

SSLContext ctx = SSLContext.getInstance("TLS");

But in my tomcat server i am setting TLSv1.2 and i am getting handshake error.

How we can support all the TLS protocols using this method like in cpp we have SSLV23 client method which will support all protocols.

like image 766
mahan07 Avatar asked Apr 24 '15 07:04

mahan07


People also ask

Which Curl version supports TLSv1 2?

2? (SSL) Forces curl to use TLS version 1.2 or later when connecting to a remote TLS server. Added in 7.34.

Is TLSv1 2 deprecated?

SSL has long been defunct — replaced by TLS and its subsequent versions — TLS 1.0, TLS 1.1, and TLS 1.2. And with TLS 1.0 and 1.1 deprecated as of the end of 2020, organizations and web hosts who wish to ensure data safety need to make the move to support TLS 1.2 across all of their deployments.


1 Answers

To use TLSv1.2 try to use below code:

SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, null);
like image 126
Rahim Rahimov Avatar answered Oct 04 '22 08:10

Rahim Rahimov