Среда: Tomcat 7.0 в Windows 2008 R2
Заставьте Tomcat 7.0 использовать определенный групповой сертификат с сопровождающей цепочкой сертификатов, чтобы браузеры клиентов не выдавали ошибок. The provided certificate is a wildcard cert. This is non-negotiable and irrelevant to getting the certificate installed.
My problem is that I cannot get tomcat to use the chain (root certificates) in addition to the main cert.
At first it took me forever to get the certificate working with the provided key pair. References 2 and 3 showed me these steps to import a provided key pair as a "PrivateKeyEntry" which Tomcat likes better:
#on a CentOS server cuz easier than getting a windows tool for it
openssl pkcs12 -export -in wildcard-customer-2016.crt -inkey wildcard-customer-2016.key -out wildcard-customer-2016.p12 -name wildcard -CAfile rapidssl.crt -caname root
#back on windows
C:\Program Files\Java\jre7\bin\keytool -importkeystore -deststorepass tomcat -destkeystore c:\.keystore -srckeystore c:\certificate\wildcard-customer-2016\wildcard-customer-2016.p12 -srcstoretype PKCS12 -alias wildcard
But I don't know how to add the root certificate so that it uses that as well. You can see the command I used to build the .p12 file included a CAfile command. The importkeystore command when run with a "-trustcacerts" didn't add the root certs, although it did work with the *.customer.com cert.
Possible alternatives
Somebody explain how to configure my server.xml
for using APR properly. Pretend I don't know where the files from the zip file go. (Reference 4)
, я использую следующие шаги, чтобы выполнить это, где
$ HOSTNAME должно быть полным доменным именем хоста (важно на шагах 2 и 3 для псевдонима).
openssl pkcs12 -export -out $HOSTNAME.pfx -inkey $HOSTNAME.key -in $HOSTNAME.cer
Затем с помощью $ HOSTNAME.pfx
keytool -importkeystore -srckeystore $HOSTNAME.pfx -srcstoretype pkcs12 -srcstorepass pazzword -destkeystore $HOSTNAME.jks -deststoretype JKS -deststorepass pazzword -srcalias 1 -destalias $HOSTNAME
Наконец, в файле server.xml Tomcat
keystoreFile="/etc/tomcat7/security/$HOSTNAME.jks"
keystorePass="pazzword"
keyAlias="$HOSTNAME"
truststoreFile="/etc/tomcat7/security/mastercert.jks"
truststorePass="changeit"
Последняя часть (хранилище доверенных сертификатов) ), если вам нужно, чтобы Tomcat доверял дополнительному CA, поэтому он может не понадобиться для вашей установки. Таким образом, хранилище ключей - это место, где находится сертификат сервера, а хранилище доверенных сертификатов - это то, кому сервер будет доверять (если вы хотите выполнить взаимную аутентификацию и т. Д.).