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

    1.环境

    tomcat8.5.9

    2.JKS 证书格式配置方法1

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

    keyAlias 一定要写,不然会有空指针异常

    JKS 证书格式配置方法2

        <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                   maxThreads="150" SSLEnabled="true" >
            <SSLHostConfig>
                <Certificate 
                    certificateKeystoreFile="C:UserspengDownloadscert.jks"
                    certificateKeyAlias="gw"
                    certificateKeystorePassword="123456"
                    type="RSA" />
            </SSLHostConfig>
        </Connector>

    certificateKeyAlias一定要写,不然会有空指针异常

    3.PEM(KEY&CRT)证书格式配置方法

        <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
                   maxThreads="150" SSLEnabled="true" >
            <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
            <SSLHostConfig>
                <Certificate certificateKeyFile="F:key.txt"
                             certificateFile="F:cert.cer"
                             type="RSA" />
            </SSLHostConfig>
        </Connector>

    证书格式转换工具:https://ssl.cfca.com.cn/Web/tool

  • 相关阅读:
    第一个只出现一次的字符
    把数组排成最小的数
    整数中1出现的次数
    连续子数组的最大和
    最小的K个数
    数组中出现次数超过一半的数字
    字符串的排列
    二叉搜索树与双向链表
    numpy中ravel()和flatten()
    复杂链表的复制
  • 原文地址:https://www.cnblogs.com/SmilingEye/p/14281288.html
Copyright © 2011-2022 走看看