我试图在ubuntu11.10中的tomcat 7中添加ssl配置,但它不工作,日志中也没有错误。我在server.xml中添加了以下内容:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
keystoreFile="mycertificate.cert"
keystorePass="mypass"
clientAuth="false" sslProtocol="TLS" />我还在web.xml中添加了以下内容:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<!-- auth-constraint goes here if you requre authentication -->
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>我也尝试过其他港口。我也尝试过重定向,但没有任何效果。
在catalina.out中,我只得到以下内容:
Feb 09, 2016 3:50:27 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8443"]
Feb 09, 2016 3:50:27 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 665 ms
Feb 09, 2016 3:50:27 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 09, 2016 3:50:27 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.21
Feb 09, 2016 3:50:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Feb 09, 2016 3:51:20 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [52,112] milliseconds.
Feb 09, 2016 3:51:20 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8443"]
Feb 09, 2016 3:51:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 52915 ms在浏览器中我得到了ERR_CONNECTION_TIMED_OUT
我还使用了curl -vlkL https://localhost:8081 --密码器DHE-RSA-SHA 256-SHA。
并返回tomcat的主页,但在浏览器中不工作。
https://serverfault.com/questions/755000
复制相似问题