Java程序员从笨鸟到菜鸟(四十四)HTTPS 证书申请和配置

一、证书生成

传送门http://ln-ydc.iteye.com/blog/1335213

二、tomcat 配置

注意: keystoreFile 路径改成自己第一步生成证书存放的路径,keystorePass 为自己配置的密码

<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" keystoreFile="C:/keystore.jks"
    keystorePass="123456" />

三、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>

猜你喜欢

转载自blog.csdn.net/u013090299/article/details/81061082
今日推荐