java - SSLContext.getInstance ("TLS") 是否也支持 TLS v1.1 和 TLS v1.2 ?

标签 java tomcat ssl openssl poodle-attack

在我的 java 代码中,我正在使用命令创建 SSL 上下文的一个实例

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

但是在我的 tomcat 服务器中,我设置了 TLSv1.2,但出现了握手错误。

我们如何使用此方法支持所有 TLS 协议(protocol),就像在 cpp 中一样,我们有 SSLV23 客户端方法,它将支持所有协议(protocol)。

最佳答案

要使用 TLSv1.2,请尝试使用以下代码:

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

关于java - SSLContext.getInstance ("TLS") 是否也支持 TLS v1.1 和 TLS v1.2 ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57806500/

相关文章:

java - 如何获取 Selenium 元素的内部文本?

java - 如何解决我的后台服务中的 "doing too much work on its main thread service"错误?

java - 如何以不同颜色打印异常

tomcat - javax.security.auth.login.LoginException : No LoginModules configured for PropertiesLoginModule

linux - AccessDeniedException与tomcat一起走树

.htaccess - 在整个 CodeIgniter 驱动的站点上强制使用 HTTPS 会创建请求循环……为什么?

java - 字符串分割模式java

tomcat - 从对象工厂访问 Tomcat JNDI 资源

google-app-engine - Google Cloud Platform 续订 SSL 证书停止应用程序服务

javascript - wss ://my. domain.com/sockjs/362/4q059yw7/websocket