java - I'm trying to import a new SSL certificate but somehow it's referring to the old one -


i have host abc.com on have installed ssl certificate, due reason host name changed xyz.com have created new ssl certificate host somehow it's still referring old certificate used abc.com.

following commands i've used create keystore , csr file:

---keystore generation command  keytool -genkey -alias xyz -keyalg rsa -keystore xyz.keystore -keysize 2048  --csr file generation command  keytool -certreq -alias xyz -file xyz.csr -keystore xyz.keystore -sigalg sha1withrsa 

from csr file i've generated trusted certificate site. there 3 certificates provided me root certificate, issuer certificate , site certiticate.

first i've imported root certificate, issuer certificate , site certificate using below commands keystore:

-- importing root certificate keytool -keystore xyz.keystore -storetype jks -storepass xyz123 -import -v -noprompt -trustcacerts -alias root -keypass xyz123 -file root.cer -keystore xyz.keystore -storetype jks -storepass xyz123  -- importing issuer certificate keytool -keystore xyz.keystore -storetype jks -storepass xyz123 -import -v -noprompt -trustcacerts -alias issuer -keypass xyz123 -file issuer.cer -keystore xyz.keystore -storetype jks -storepass xyz123  -- importing site certificate keytool -keystore xyz.keystore -storetype jks -storepass xyz123 -import -v -noprompt -trustcacerts -alias xyz -keypass xyz123 -file xyz.cer -keystore xyz.keystore -storetype jks -storepass xyz123 

now check if certificates imported in keystore i've used below command:

keytool -list -keystore xyz.keystore 

i can see 4 entries in keystore, 1 privatekeyentry , 3 trustcertentries.

now i've used keystore , keypass in connector tag of server.xml file of tomcat. server.xml entry looks below:

 <connector port="8443" scheme="https" secure="true" clientauth="false" sslprotocol="tls" maxhttpheadersize="8192" maxthreads="150" minsparethreads="25"   maxsparethreads="75" enablelookups="false" acceptcount="100"   disableuploadtimeout="true" keystorefile="xyz.keystore" keystorepass="xyz123"/> 

i restarted server , tried accessing application it's still referring old certificate.

any appreciated.

you should not have specified -trustcacerts when importing signed certificate. there should 2 trusted entries , 1 private key. haven't disturbed private key entry @ all.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -