[英]Secure connection in localhost tomcat not working
我正在使用Maven开发Spring Web应用程序。 我正在尝试使localhost安全连接。我正在使用tomcat服务器。 我使用此链接创建了自己的CA,并将其添加到JVM。 这就是我在pom.xml中添加的内容。
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/security</path>
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="200" scheme="https" secure="true" keystoreFile="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64/jre/lib/security/cacerts.jks" keystorePass="security"
clientAuth="false" sslProtocol="TLS" />
</configuration>
</plugin>
我去了链接: https:// localhost:8443 。 但是该端口上没有运行任何应用程序。 有人可以帮忙吗?
转到sever.xml并添加以下xml
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="{path}/mycer.cert" keystorePass="{password}"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
如果重新启动注释堆栈跟踪有任何问题
http://www.mkyong.com/tomcat/how-to-configure-tomcat-to-support-ssl-or-https/
您需要在servlet.xml
文件中添加连接器。
<Connector
protocol="org.apache.coyote.http11.Http11Protocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
用您拥有的密钥库文件路径和密码替换。
请参阅https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.