我正面临为tomcat设置SSL证书的问题。我将在下面解释我遵循的步骤
@
和value
提供的gd_bundle-g2-g1.crt
(根证书)gdig2.crt.pem
(中间证书)a20b537a8b66f79f.crt
(我的网站证书)keytool -import -alias root -keystore tomcat.keystore -trustcacerts
file gd_bundle-g2-g1.crt
keytool -import -alias intermed -keystore tomcat.keystore -trustcacerts -file gdig2.crt.pem
keytool -import -alias tomcat -keystore tomcat.keystore -trustcacerts -file a20b537a8b66f79f.crt
Connector port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true" keystoreFile="/home/dds/dont_remove_ssl/tomcat.keystore" keystorePass="changeit" clientAuth="false" sslProtocol="TLS"/>
keytool -list -keystore /home/dds/dont_remove_ssl/tomcat.keystore
验证了证书导入,这是输出
root, Nov 9, 2017, trustedCertEntry,
Certificate fingerprint (SHA1): 27:AC:93:69:FA:F2:52:07:BB:26:27:CE:FA:CC:BE:4E:F9:C3:19:B8
tomcat, Nov 9, 2017, trustedCertEntry,
Certificate fingerprint (SHA1): D1:1B:39:38:53:40:AE:DC:7B:06:FC:A2:72:9F:3C:60:68:0B:BB:D5
。 这似乎是个问题,因为此条目的类型必须为 PrivateKeyEntry
,而不是 intermed, Nov 9, 2017, trustedCertEntry,
Certificate fingerprint (SHA1): 27:AC:93:69:FA:F2:52:07:BB:26:27:CE:FA:CC:BE:4E:F9:C3:19:B8
更新我的应用web.xml
以在我的应用上启用SSL
<security-constraint>
<web-resource-collection>
<web-resource-name>DDS</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
但是这种配置不起作用。我收到错误ssl_error_no_cypher_overlap
以下stackoverflow帖子与我面临的这个问题相关。但是他们提到的删除-trustcacerts
标志的解决方案并没有解决我的问题
答案 0 :(得分:0)
您必须使用与创建原始密钥对和CSR时相同的别名,将证书导入到生成CSR的同一密钥库中。