HTTPS是一个基于SSL的安全http连接
HTTPS的默认端口是443
1,首先要生成证书
进入命令行,切换到%JAVA_HOMT%/bin目录下,用keytool命令
keytool -genkey -alias youkeyfilename -keyalg RSA -keystore c:/path
-alias youkeyfilename是表示生成的这个证书的别名叫youkeyfilename,
-keyalg RSA指的是采用的RSA算法,
-keystore c:/path是指生成的证书存储的位置。
2,配置server.xml文件
<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="C:/tomcatkey" keystorePass="kaihui12" />