简体   繁体   中英

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.

To use TLSv1.2 try to use below code:

SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM