如何在Java中设置TLS1.2版本 [英] How to set TLS1.2 version in Java

查看:188
本文介绍了如何在Java中设置TLS1.2版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境详细信息:

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode).

我们正在使用jboss-4.2.3.GA和使用ejb的胖客户端。

We are using jboss-4.2.3.GA and thick client using ejb.

我们尝试通过以下方式设置TLS1.2版本:

And we have tried to set the TLS1.2 version in the following ways:


  1. 控制面板 - >程序 - > Java - >高级选项卡 - >高级安全设置
    检查TLS1.1和TLS1.2并取消选中剩余的旧版本。
    但仍然在Wire shark软件中我们看到客户端只与TLSV1中的服务器通信。

  1. Control Panel --> Programs-->Java-->Advanced Tab-->Advanced Security Settings checked the TLS1.1 and TLS1.2 and unchecked the remaining old versions. But still in Wire shark software we are seeing client is talking to server in TLSV1 only.

-Ddeployment.security .SSLv2Hello = false -Ddeployment.security.SSLv3 = false -Ddeployment.security.TLSv1 = false -Ddeployment.security.TLSv1.1 = true -Ddeployment.security.TLSv1.2 = true

在启动脚本中给出,但在Wire shark软件中,我们看到客户端仅在TLSV1中与服务器通信。

Given in the startup script, but in Wire shark software we are seeing client is talking to server in TLSV1 only.

参考链接: https:// superuser .com / questions / 747377 / enable-tls-1-1-and-1-2-for-clients-on-java-7

jdk.tls.disabledAlgorithms = SSLv2Hello,SSLv3,TLSv1,TLSv1.1

in jre / lib / security / java.security jdk1.7.0_40 / jre / lib / security / java.security 。但仍然在Wire shark软件中,我们看到客户端只与TLSV1中的服务器通信。

in the jre/lib/security/java.security and jdk1.7.0_40/jre/lib/security/java.security. But still in Wire shark software we are seeing client is talking to server in TLSV1 only.

参考链接:如何强制java服务器只接受tls 1.2并拒绝tls 1.0和tls 1.1连接

有人可以告诉我们如何为客户端和服务器强制执行TLS1.2版本。

Can somebody tell us how enforce TLS1.2 version for both client and server.

推荐答案

我正在使用Tomcat 6和Java 7,因为java 6及更早版本不支持TLS1.2。

I'm using Tomcat 6 with java 7 because java 6 and earlier versions don't support TLS1.2.

为了配置我的服务器,我做了以下工作:

For configuring my server I did the following:


  1. 在标签Connector上修改了文件server.xml,其属性为sslEnabledProtocols如下:





<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="450" scheme="https" secure="true"
           keystoreFile="<your_keystore>" keystorePass="<somepasswd>" clientAuth="false"
           keyAlias="tomcat" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
           URIEncoding="UTF-8" maxHttpHeaderSize="32768" 
           ciphers = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
                      TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,
                      TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA" />




  1. 我测试了整个申请,以避免兼容性。

这篇关于如何在Java中设置TLS1.2版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆