zoukankan      html  css  js  c++  java
  • tomcat配置https

    1、开启使用https协议

    编辑tomcat目录下的conf/server.xml文件

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

    keystoreFile:证书路径(相对与tomcat主目录,例如:conf/SSL.jks)

    keystorePass:证书密码

    2、强制使用https协议

    tomcat主目录的 conf/web.xml 中的 </welcome- file-list>节点后面加上这

     <login-config>  
        <!-- Authorization setting for SSL -->  
        <auth-method>CLIENT-CERT</auth-method>  
        <realm-name>Client Cert Users-only Area</realm-name>  
     </login-config>  
     <security-constraint>  
         <!-- Authorization setting for SSL -->  
         <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>  
  • 相关阅读:
    洛谷P3811题解
    洛谷P3353在你窗外闪耀的星星-题解
    Map根据value来排序
    java8 groupby count
    Java反射
    maven profile环境切换
    获取nginx代理情况下的真实ip
    获取request里header的name和value
    git 删除iml文件
    java list 排序
  • 原文地址:https://www.cnblogs.com/anai/p/5140232.html
Copyright © 2011-2022 走看看