Tomcat 配置SSL证书
1.将证书放到tomcat或tomcat子目录下(如tomcat/conf等)
2.修改tomcat/conf下的server.xml文件
找到如下注释下的配置并修改:
<!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation --> <Connector port="8080" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" URIEncoding="UTF-8" connectionTimeout="20000" clientAuth="false" sslProtocol="TLS" keystoreFile="D:\apache-tomcat\test.com.jks" keystorePass="1234" />
keystoreFile为证书路径,
keystorePass为对应密码。
修改完成后需重启tomcat。