简体   繁体   English

在Tomcat 8上设置SSL

[英]Setting up SSL on Tomcat 8

I'm trying to configure Tomcat 8 on Windows for SSL. 我正在尝试在Windows上为SSL配置Tomcat 8。

I've followed the instructions here: 我已按照此处的说明进行操作:

https://www.mulesoft.com/tcat/tomcat-ssl https://www.mulesoft.com/tcat/tomcat-ssl

so, I've created the a keystore: 因此,我创建了一个密钥库:

keytool -genkey -alias Procon -keyalg RSA -keystore $TOMCAT_HOME\Keystore

and a CSR: 和企业社会责任:

keytool -certreq -keyalg RSA -alias Procon -file cert.csr -keystore $TOMCAT_HOME\Keystore

and I've had the root file and new cert back from the provider and installed them in the keystore: 我已经从提供者那里获得了根文件和新证书,并将它们安装在密钥库中:

keytool -import -alias rootca -keystore $TOMCAT_HOME\Keystore -trustcacerts -file root.txt

keytool -import -alias inter -keystore $TOMCAT_HOME\Keystore -file newssl.txt

Then in Tomcat's serverl.xml I've uncommented and updated: 然后在Tomcat的serverl.xml中,我已取消注释和更新:

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" 
               keystoreFile="C:\Program Files\Apache Software Foundation\Tomcat 8.0_Tomcat8(Procon)\Keystore" 
               keystorePass="..."
               keyAlias="inter"
               />

and restarted, but when I go to: 并重新启动,但是当我转到:

https://<host>:8443

I just get a timeout and I'm stumped. 我只是超时而感到难过。 No one on stackoverflow appears to have had this particular issue. 在stackoverflow上似乎没有人遇到过这一特殊问题。 Port 8080 is still working as it should. 端口8080仍然可以正常工作。

I'm also a bit confused about the other connectors appearing to redirect to 8443: 我对其他似乎重定向到8443的连接器也有些困惑:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

 <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

I think you have to create a key with the alis tomcat instead of Procon . 我认为您必须使用alis tomcat而不是Procon创建密钥。

keytool -genkey -alias tomcat -keyalg RSA...

And don't forget to use the same password for the keystore as for the key! 并且不要忘记为密钥库使用密钥相同的密码

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

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