配置webapp以在tomcat7上的ssl证书上运行

时间:2014-08-06 01:25:18

标签: tomcat tomcat7 ssl-certificate

如何配置tomcat 7以使用我刚刚购买的新证书?我在我的server.xml上取消注释了https连接器,它看起来像这样:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
    maxThreads="150" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS"
    keystoreFile="/home/tomcat7/.keystore" keystorePass="my-pass"/>

我的webapp包含一个配置为:

的web.xml文件
<security-constraint>
    <web-resource-collection>
        <web-resource-name>Viewpoint Secure URLs</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

当我尝试在

上访问它时
https://[IP_ADDRESS]:8443/

它只是返回无法加载页面。但是在没有传输保证的情况下部署相同的webapp可以保证我的webapp在8080上的http协议上运行良好。

另一个可能有用的事实:

  1. 我已将此证书购买到我自己的域中,并且我将其置于不响应此域的新服务器上。所以我试图通过服务器公共IP访问它。
  2. 从桌面尝试wget后收到以下错误:&#34; OpenSSL:错误:14077410:SSL例程:SSL23_GET_SERVER_HELLO:sslv3警报握手失败&#34;
  3. 这是我第一次购买证书,所以我可能(希望不会)在流程的任何地方做错了...比如创建密钥库,或CSR或其他任何东西:/
  4. 我没有完成此链接(https://www.alphassl.com/support/install-root/tomcat.html)中描述的第一次导入,因为此其他链接(https://www.alphassl.com/support/install-root-certificate.html)表示我不需要在我的服务器上安装根证书。它们,根证书和globalsignrootCA.cer,是一回事吗?
  5. 任何想法?我是否可以使用我的服务器IP地址通过签名证书访问我的webapp,还是只能通过连接到我的证书的域访问我的webapp?

    谢谢!

1 个答案:

答案 0 :(得分:1)

首先验证tomcat是否正在查找并加载密钥库文件(如果有任何错误,请在catalina.out中进行验证)。但是,由于您的域名存在密钥库,因此无法使用您的ipaddress访问您的网址,您应该访问包含域名的网址,例如说https://abc.com:8443

相关问题