2016-08-17 161 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