2016-08-17 166 views
0

我的任務是在Apache Tomcat服務器(版本7.0.35)上安裝SSL證書。這是我以前沒有任何經驗,所以希望有一點指導!我在網上找到的筆記似乎只包括新的安裝。Apache Tomcat/7.0.35 SSL證書安裝

查看server.xml文件,我可以看到現有的SSL證書以及密鑰庫配置。

請任何人都可以告訴我,在server.xml已經有一些存在的情況下,生成和添加新的SSL證書的過程是什麼?例如,我是否需要刪除現有實例,或者只需添加一個新實例,是否需要對密鑰庫文件進行進一步更改?

回答

0
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

enter image description here

然後點擊URL https://localhost:8443/

enter image description here

+0

謝謝您的回覆作者Abhijit,如何將添加已在.PFX格式被提供的證書。這可能嗎? – NAP50

+0

是可能的,這對你有用,然後請給我一個打勾... 只使用擴展名爲.pfx而不是.jks –

+0

感謝您解釋Abhijit。 – NAP50