【发布时间】:2015-07-19 09:06:58
【问题描述】:
Ubuntu 14、tomcat 7、java 7
our.crt、our.key 和 gd_bundle-g2-g1.crt 由 godaddy 提供。捆绑包中有 3 个证书(通过查看文件可以看出)。
注意,我们的 key 和 crt 在 node.js 上使用没有问题。
我们因此从现有的 crt 创建了一个密钥库:
cd /etc/ssl
openssl pkcs12 -export -in our.crt -inkey our.key -out our.p12 -name tomcat -CAfile gd_bundle-g2-g1.crt -caname root -chain
server.xml 是这样的:
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="200" scheme="https" secure="true"
keystoreType="PKCS12"
keystoreFile="/etc/ssl/our.p12" keystorePass=""
clientAuth="false" sslProtocol="TLS" />
- Tomcat 启动时没有错误。
- webapp 在端口 80 上运行良好。
- 服务器没有运行任何固件。
我们设置了一个从 443 到 8443 的本地重定向:
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443
那就试试https://www.ourserver.com/ourapp
Chrome 给出:ERR_SSL_VERSION_OR_CIPHER_MISMATCH
在本地机器上运行的 curl 示例:
curl -Iv https://www.ourserver.com:8443
* Rebuilt URL to: https://www.ourserver.com:8443/
* Hostname was NOT found in DNS cache
* Trying 1xxxxxxxx...
* Connected to www.ourserver.com (1xxxx) port 8443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
有什么想法吗?
更新 1
我尝试在新服务器上设置新的 tomcat 7,并安装了新的证书副本,但遇到了同样的错误。
【问题讨论】:
-
由于此“握手失败”警报是由服务器发送的,因此在调试问题时应查看服务器端,即查看来自 tomcat 的日志消息。
-
遗憾的是,catalina.out 中没有错误
-
localhost.* 或其他 tomcat 日志文件中是否有任何错误?
-
localhost_access_log.yyyy-mm-dd 在我点击 SSL 端口并在 chrome 中返回 ERR_SSL_VERSION_OR_CIPHER_MISMATCH 消息时没有条目
-
为什么不在 Apache Web Server 后面运行它?