Skip to content

Tomcat KeyStore 安装证书

Tomcat 通常使用 JKS 或 PKCS12 KeyStore。

从 PFX 转换为 JKS

将文件名和密码替换成你的真实信息:

bash
keytool -importkeystore   -srckeystore domain-com.pfx   -srcstoretype pkcs12   -srcalias 1   -srcstorepass 123456   -destkeystore domain-com.jks   -deststoretype jks   -deststorepass 123456   -destalias server

Tomcat Connector 示例

xml
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true">
    <SSLHostConfig>
        <Certificate certificateKeystoreFile="/path/domain-com.jks"
                     certificateKeystorePassword="123456"
                     type="RSA" />
    </SSLHostConfig>
</Connector>

重启 Tomcat 后访问 HTTPS。

Released under internal 12SSL documentation guidelines.