【发布时间】:2017-09-01 06:50:35
【问题描述】:
我有一个在 tomcat 上运行的 webapp。现在我想强制执行 https。我收到了 3 个保存在 tomcat/conf/ 中的文件:localhost-rsa-cert.pem、localhost-rsa-chain.pem 和 localhost-rsa-key.pem
我更改了 server.xml,使未注释的连接器看起来像这样并重新启动了 tomcat。我只能使用 ...com:8080 而不是 ...com:8443 访问我的页面。有什么问题?
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
我读到您也需要更改 web.xml 中的某些内容。
【问题讨论】:
-
端口 8443 会发生什么?
-
@EJP 超时错误