• Centos下配置tomcat7的https证书


    近期搞定了HTTPS配置,特此记录。

    1、把下载的文件拷贝到cert文件夹,然后放在tomcat根目录下(与conf同一级目录)。
    2、配置conf下的server.xml,修改下面3个节点,如下:

    <Connector port="80" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="443" />
    <Connector port="443" protocol="HTTP/1.1"
    maxThreads="150" SSLEnabled="true" scheme="https" secure="true" 
    keystoreFile="cert/your-name.pfx" 
    keystoreType="PKCS12" 
    keystorePass="you-password"
    clientAuth="false" sslProtocol="TLS" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />


    3、配置conf下的web.xml,让http自动跳转https。在</web-app>前加入下面配置即可。

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

    4、在服务器上重启tomcat的,访问你的网站。

  • 相关阅读:
    svn进行Update操作失败 提示lock
    strust2自定义拦截器
    nginx相关特性及使用
    在linux服务器上部署springboot项目,并用nginx映射域名
    centos7 安装redis-6.0.6
    centos 7安装mysql 8教程
    centos7 设置系统时间
    centos7 fastdfs安装
    过滤器相关
    FastDFS相关
  • 原文地址:https://www.cnblogs.com/xjxz/p/7843679.html
Copyright © 2020-2023  润新知