tomcat配置ssl.支持https
1,找到tomcat安装目录conf/server.xml
<!–
<Connector port=”8443″ protocol=”HTTP/1.1″ SSLEnabled=”true”
maxThreads=”150″ scheme=”https” secure=”true”
clientAuth=”false” sslProtocol=”TLS” />
–>
取消注释改为(keystoreFile为证书文件目录,keystorePass证书密码):
<Connector port=”443″ protocol=”org.apache.coyote.http11.Http11Protocol” SSLEnabled=”true”
maxThreads=”150″ scheme=”https” secure=”true”
keystoreFile=”conf\SHA256withRSA_www.591kst.com.jks”
keystorePass=”990416wlm”
clientAuth=”false” sslProtocol=”TLS” />
2,将以下两处8443端口改443
<Connector port=”80″
<Connector port=”8009″
3,项目web.xml 添加
<security-constraint>
<web-resource-collection >
<web-resource-name >SSL</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
4,重启tomcat