帮助中心 > 问题列表 > Tomcat环境安装SSL数字证书教程

Tomcat环境安装SSL数字证书教程

Tomcat安装SSL证书需要,FullSSL.jks和密码.txt文件

1.将证书文件放到网站根目录

将FullSSL.jks和密码.txt文件上传到网站根目录,新建一个文件夹放进去

2.访问Tomcat安装目录/conf/server.xml目录,打开server.xml文件。在</Engine>后添加下面配置

<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="/path/to/your_keystore.jks" keystorePass="your_password" clientAuth="false" sslProtocol="TLS"/>

http重定向到https(可选)

打开Tomcat的配置文件web.xml添加下面配置

<login-config>

  <auth-method>CLIENT-CERT</auth-method>

  <realm-name>Client Cert Users-only Area</realm-name>

</login-config>

<security-constraint>

  <web-resource-collection>

    <web-resource-name>SSL</web-resource-name>#请将该参数替换为您的项目名称,server.xml的host的name值。

    <url-pattern>/*</url-pattern>

  </web-resource-collection>

  <user-data-constraint>

    <transport-guarantee>CONFIDENTIAL</transport-guarantee>

  </user-data-constraint>

</security-constraint>


如需购买SSL,请访问:https://www.itrustssl.cn/