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

a 夏天 提交于 2019-12-21 03:54:17

问题


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.


回答1:


To use TLSv1.2 try to use below code:

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


来源:https://stackoverflow.com/questions/29841610/will-sslcontext-getinstancetls-supports-tls-v1-1-and-tls-v1-2-also

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!