1:打开tomcat的conf文件夹下的server.xml
默认配置的是
<Connector port="18080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="18443" />
改为
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="d:/123456.pfx" keystoreType="PKCS12" keystorePass="123456" />
重启tomcat后就生效了,https配置成功后,http就访问不了了,只能用https访问
后记如果遇到严重: Failed to initialize end point associated with ProtocolHandler ["http-apr-443"]
java.lang.Exception: Connector attribute SSLCertificateFile must be defined when using SSL with APR
类似这样的错误改为
<