简体   繁体   English

如何为 tomcat 网络服务器连接启用 TLS1.2 我们正在使用 tomcat 7.0.82

[英]How to enable TLS1.2 for tomcat webserver connections We are using tomcat 7.0.82

I have a tomcat webapp where the client is using TLS1.2 but a technical scan found the server is still using TLS1.0.我有一个 tomcat webapp,其中客户端使用 TLS1.2,但技术扫描发现服务器仍在使用 TLS1.0。 I want to enable TLS1.2.我想启用 TLS1.2。 We are using Java 7 and the connector snippet for the server.xml is as below,我们正在使用 Java 7 和服务器的连接器片段。xml 如下所示,

   <Connector SSLEnabled="true" acceptCount="100" clientAuth="true" disableUploadTimeout="true" enableLookups="true" connectionTimeout="300000" 
            socket.soLingerOn="false" maxKeepAliveRequests="1000" maxThreads="50" port="2024" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS" 
            keystoreFile="/cert/fic_rest.jks" keystorePass="********" 
            truststoreFile="/cert/fic_rest.jks" server="UnIdentified" compression="on" compressionMinSize="2048" 
            noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"
    />
<!-- Define an AJP 1.3 Connector on port 2023 -->
<Connector port="2023" protocol="AJP/1.3" redirectPort="2022" />

    <Connector  acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="true" connectionTimeout="300000" 
            socket.soLingerOn="false" maxKeepAliveRequests="1000" maxThreads="50" port="2020" protocol="org.apache.coyote.http11.Http11NioProtocol" server="UnIdentified"
    />

Would changing "sslProtocol="TLS" to "sslProtocol="TLSv1.2" is all that is enough?"sslProtocol="TLS"更改为"sslProtocol="TLSv1.2"就足够了吗? We are using tomcat 7.0.82我们正在使用 tomcat 7.0.82

The sslProtocol configuration protocol does next to nothing: it only specifies which SSLContext to use, but from the perspective of a server this does not restrict anything. sslProtocol配置协议几乎什么都不做:它只指定使用哪个SSLContext ,但从服务器的角度来看,这并没有限制任何东西。 Any version of SSLContext sets the default SSL server protocols to the entire list of supported protocols (cf. source code ).任何版本的SSLContext都将默认的 SSL 服务器协议设置为支持的协议的整个列表(参见源代码)。

Therefore you need to set sslEnabledProtocols="TLSv1.2" (cf. Tomcat documentation ) to restrict the accepted protocol versions to only TLS 1.2.因此,您需要设置sslEnabledProtocols="TLSv1.2" (参见Tomcat 文档)以将接受的协议版本限制为仅 TLS 1.2。 You can then test your configuration using curl .然后,您可以使用curl测试您的配置。

However, if usage of TLS versions less then 1.2 is a security constraint for the whole system (cf. this question ) by adding the following line to $JRE_HOME/lib/security/java.security :但是,如果使用低于 1.2 的 TLS 版本,则通过在$JRE_HOME/lib/security/java.security中添加以下行是整个系统的安全约束(参见这个问题):

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

Warning: this will influence all TLS connections in Java, even those with old databases.警告:这将影响 Java 中的所有 TLS 连接,即使是旧数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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