• 配置ssl


    1、配置

    <Connector port="80" protocol="HTTP/1.1" 
                   connectionTimeout="20000" 
                   redirectPort="443" />
    <Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
                   maxThreads="150" scheme="https" secure="true"
                   clientAuth="false" sslProtocol="TLS" 
                keystoreFile="cert/xxx.jks" keystorePass="xxxxx"/>
    
    <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
    

      密码设置成一样的,省心;

    2、在tomcat 下mkdir cert,在cert下根据命令创建jks:

    keytool -importkeystore -srckeystore 2#############951.pfx -destkeystore sslkey.jks -srcstoretype PKCS12 -deststoretype JKS

    3、开启443防火墙;

    4、conf 下的web.xml配置

    <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
        </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>
    

      *******************************现在用的下面的*********************************

    1、下载tomcat的证书,解压;

    2、上传到Tomcat根目录下的cert文件夹

    3、配置server.xml

        <Connector port="80" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="443"  URIEncoding="UTF-8" useBodyEncodingForURI="true"/>
    			   
    		<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150"
              SSLEnabled="true">
                <SSLHostConfig>
                <Certificate  certificateKeystoreFile="cert/2075587_beicaiduo.com.pfx"
                certificateKeystorePassword="VV5OflnA"
                 certificateKeystoreType="PKCS12" />
    			 </SSLHostConfig>
        </Connector>
    	 <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
    

      4、防火墙,阿里云的安全配置

    5、重启完事

    www.beicaiduo.com
  • 相关阅读:
    研究SandHook
    MYSQL 事务与锁
    Java创造者詹姆斯·高斯林采访
    mybatis like 模糊查询
    【科普】彻底搞清楚什么是交换机什么是路由器。程序员基本功哦
    MinIO的简单使用实践
    如何将微信公众号的文章怎么保存转化为word文档?
    如何在recoil中主动刷新seloctor中缓存的值
    【译文】探索Recoil中的异步请求
    魅族云相册批量下载方案
  • 原文地址:https://www.cnblogs.com/hoge66/p/9682670.html
Copyright © 2020-2023  润新知