Go to bin folder in server
Run the command
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048
then
keytool -list -keystore keystore.jks
In conf\server.xml edit it as
//...
<!-- 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="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="my key store file path"
keystorePass="password" />
//...
keystorePass =「password」是您通過「keytool」命令分配給密鑰庫的密碼。
![enter image description here](https://i.stack.imgur.com/bLizb.png)
![enter image description here](https://i.stack.imgur.com/vFCvt.jpg)
然後點擊URL https://localhost:8443/
![enter image description here](https://i.stack.imgur.com/0JtHe.jpg)
謝謝您的回覆作者Abhijit,如何將添加已在.PFX格式被提供的證書。這可能嗎? – NAP50
是可能的,這對你有用,然後請給我一個打勾... 只使用擴展名爲.pfx而不是.jks –
感謝您解釋Abhijit。 – NAP50