[英]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.