我已经安装了tomcat,它运行得很好。
但是,我无法通过https层访问它。
端口8080正常工作:
curl -IL http://localhost:8080 HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/html;charset=ISO-8859-1 Transfer-Encoding: chunked Date: Sat, 27 Apr 2013 16:20:23 GMT
端口8443不响应:
curl -IL https://localhost:8443 curl: (7) couldn't connect to host
这行在我的server.xml中是未注释的
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="/usr/me/.keystore" keystorePass="somepwd" />
我甚至将协议更改为"org.apache.coyote.http11.Http11Protocol"但这也没有帮助。
每次更改之后,我都重新启动了tomcat服务:
curl https://localhost:8443 curl: (7) couldn't connect to host
我的tomcat版本是7.0.39
我用这个命令生成了我的.keystore文件keytool -genkey -alias tomcat -keyalg RSA
改变你的设置,如下所示,它应该工作
<!-- SSL Port 8443 --> <Connector port="8443" maxThreads="150" scheme="https" secure="true" SSLEngine="on" SSLCertificateFile="mycert.crt" SSLCertificateKeyFile="mykey.pem" SSLPassword="....." clientAuth="false" sslProtocol="TLS"/>