在Tomcat 6和7上安装通配符SSL证书

我已经按照goDaddy网站上给出的信息获取SSL证书并安装它,但不成功。

我创build了密钥库:

keytool -keysize 2048 -genkey -alias tomcat -keyalg RSA -keystore D:\certificates\tomcat.keystore 

产生了CSR:

 keytool -certreq -keyalg RSA -alias tomcat -file D:\certificates\bimacsr.csr -keystore D:\certificates\tomcat.keystore 

在goDaddy网站上传CSR后,下载的证书下载到一个包含3个以下文件的zip文件中 –

  1. gd_bundle-g2-g1.crt
  2. gdig2.crt.pem
  3. 1c1f16606d7eadb7.crt

然后使用下面的三行安装并将证书导入到密钥库:

  1. keytool -import -alias root -keystore D:\certificates\tomcat.keystore -trustcacerts -file D:\certificates\gd_bundle-g2-g1.crt

  2. keytool -import -alias intermed -keystore D:\certificates\tomcat.keystore -trustcacerts -file D:\certificates\gdig2.crt.pem

  3. keytool -import -alias tomcat -keystore D:\certificates\tomcat.keystore -trustcacerts -file D:\certificates\1c1f16606d7eadb7.crt

最后在conf/ tomcat 6和7的server.xml文件中进行更改

 <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" SSLEnabled="true" clientAuth="false" sslProtocol="TLS" keystoreFile="D:\certificates\tomcat.keystore" keystorePass="mypwd" /> 

但是,当我们在浏览器中访问左边的“不安全”

 https://localhost:8443/ https://< public domain name>:8443/ 

请看看上面的解释,并build议和帮助,如果我错过了任何一步或做错任何事情。

在这里输入图像说明