[英]Secure connection in localhost tomcat not working
I am working on spring web app using maven. 我正在使用Maven开发Spring Web应用程序。 I am trying to make localhost a secure connection.I am using tomcat server.
我正在尝试使localhost安全连接。我正在使用tomcat服务器。 I used this link for creating my own CA and added it to JVM.
我使用此链接创建了自己的CA,并将其添加到JVM。 This is what I added in pom.xml.
这就是我在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>
I went to the link: https://localhost:8443 . 我去了链接: https:// localhost:8443 。 But no app is running on that port.
但是该端口上没有运行任何应用程序。 Could someone please help?
有人可以帮忙吗?
Go to sever.xml and add following xml 转到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"/>
if any problem for restarting comment stack trace 如果重新启动注释堆栈跟踪有任何问题
http://www.mkyong.com/tomcat/how-to-configure-tomcat-to-support-ssl-or-https/ http://www.mkyong.com/tomcat/how-to-configure-tomcat-to-support-ssl-or-https/
You need to add a connector in servlet.xml
file. 您需要在
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"/>
Replace the keystore file path and the password with the ones you have. 用您拥有的密钥库文件路径和密码替换。
Refer https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html . 请参阅https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.