1
我已經按照以下步驟在NetBeans中的tomcat中配置了HTTPS,但是當我嘗試通過HTTPS訪問該站點時,出現錯誤「安全連接失敗」。請幫助無法使用Netbeans在Tomcat中配置HTTPS
1)生成密鑰
keytool -genkey -alias Crunchify -keyalg RSA -keystore
2)複製鍵<tomcat installation dir>
/conf目錄
3)修改server.xml文件
<Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="false" keystoreFile="conf/.keystore" keystorePass="password" maxThreads="25" port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS"/>
4)打開項目web.xml並在<web-app>
下加了下面的標籤
<security-constraint>
<display-name>Constraint2</display-name>
<web-resource-collection>
<web-resource-name>secure</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<description/>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>