2012-05-08 56 views
25

我有一個基於java的客戶端(使用java 1.6.30),打開一個SSL連接到我部署在Tomcat 7.0.26上的服務器。 Tomcat正在使用Java 6,並在server.xml中將連接器配置爲使用sslProtocol="TLS"如何找到在Java中使用什麼SSL/TLS版本

我想知道什麼SSL版本被使用?它是TLS1.0嗎? TLS1.1?還有別的嗎?

回答

26

從您的客戶的SSLSocket獲取SSLSession並使用其getProtocol()方法。

Oracle JRE/OpenJDK 6 supports SSLv3 and TLS 1.0。您至少需要IBM JRE 6/7Oracle JRE/OpenJDK 7 to get support for TLS 1.1 and TLS 1.2。 (這也與可用密碼套件有關,如this question中所述。)

+0

Oracle Java 6 suports TLS 1.1(http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames .html#SSLContext) – emstol

+0

嗯..另一方面,這裏oracle告訴我TLS 1.1在Java 6中不被支持https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https – emstol

+4

@emstol [Standard名稱](http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#SSLContext)文件是關於正式名稱(實質上,它是提前計劃)。 Oracle的[SunJSSE提供程序(與「普通」Oracle JRE一起提供的那個提供程序)](http://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider)沒有不支持Oracle JRE 6中的TLS 1.1。 – Bruno