• 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

  • 相关阅读:
    shell 指令
    在Linux下搭建nRF51822的开发烧写环境(makefile版)
    宏定义。字符串拼接和字符串整形转字符串
    django-debug-toolbar安装过程中的error
    pipenv
    Docker 命令大全
    MySQL性能优化
    docker操作
    使用网易源解决docker下载镜像文件慢的问题
    w3school/jQuery 教程
  • 原文地址:https://www.cnblogs.com/SmilingEye/p/14281288.html
Copyright © 2020-2023  润新知