1.tomcat服务器https配置
在conf的server.xml文件中,添加https连接的配置.
添加成功后,在浏览器里面输入https://localhost:8443可以访问tomcat主页。
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="conf/alipay.keystore" keystorePass="123456"
clientAuth="false" sslProtocol="TLS"/>
2.利用jdk中的ketool.exe生成keystore密钥对。
>keytool -genkeypair -alias 密钥别名 -keyalg 密钥算法 -validity 有效期 -keystore 密钥名称
>keytool -genkeypair -alias alipay -keyalg RSA -validity 3650 -keystore alipay.keystore
执行命名的当前文件路径下会生成keystore文件。
3.通过keytool将keystore生成证书,keystore里面有公钥私钥,证书只包含公钥。
证书