在 Tomcat 8 上配置 SSL 和连接超时

问题描述:

我设置了一个密钥库并从 openssl.com 获得了 SSL 证书.我遵循的确切步骤在这里:https://drive.google.com/file/d/0B6PUGo7cBLcDTzdkc0pzT2pTMk0/view?usp=sharing

I setup a keystore and got a SSL cert from openssl.com. The exact steps I followed are here: https://drive.google.com/file/d/0B6PUGo7cBLcDTzdkc0pzT2pTMk0/view?usp=sharing

不幸的是,即使完全按照他们的 tomcat 说明并与客户支持合作,我的 https 连接也超时.

Unfortunately even after following their instructions for tomcat exactly and working with customer support my https connection times out.

貌似tomcat已经启动并运行了,监听443端口,但是不知道怎么调试更深.Http 请求服务得很好,所以我知道 tomcat 本身工作得很好.

It seems like tomcat is up and running, listening on port 443, but I don't know how to debug deeper. Http requests are served just fine, so I know tomcat itself is working just fine.

[ec2-user@ip- logs]$ sudo netstat -tunlp | grep 443 
tcp6       0      0 :::443                  :::*                    LISTEN      19407/java

[ec2-user@ip- logs]$ ps -ef | grep java 
root     19407     1  1 23:03 pts/0    00:00:06 /usr/java/jre1.8.0_60//bin/java
-Djava.util.logging.config.file=/usr/apache-tomcat-8.0.26//conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/apache-tomcat-8.0.26//endorsed -classpath /usr/apache-tomcat-8.0.26//bin/bootstrap.jar:/usr/apache-tomcat-8.0.26//bin/tomcat-juli.jar -Dcatalina.base=/usr/apache-tomcat-8.0.26/ -Dcatalina.home=/usr/apache-tomcat-8.0.26/ -Djava.io.tmpdir=/usr/apache-tomcat-8.0.26//temp org.apache.catalina.startup.Bootstrap start ec2-user 19449 18021  0 23:13 pts/0    00:00:00 grep --color=auto java

我的连接器配置为:

<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" KeystoreFile="/home/ec2-user/.keystore" KeystorePass="password" />

请帮忙!

当我配置 tomcat 时,如果在我看到任何响应之前出现延迟,几乎总是因为 PORT 由于某种原因被阻塞了.您是否通过防火墙打开了 443 端口(假设这是在外部服务器上完成的)?

When I configure tomcat, if there's a delay before I see any response, it is almost always because the PORT is blocked for some reason. Are you positive port 443 is open through the firewall (assuming this is being done on an external server)?

如果您的标准端口工作正常,但 443 只是在出现故障之前静置和旋转一段时间,我会将我的钱放在一个阻塞的端口上.

If your standard port works fine but 443 just sits and spins for a period of time before failing, I'd put my money on a blocked port.