If you are getting SSLHandshakeException - unable to find valid certification path to requested target ,please follow below steps
In future many folks amongst us needs to import certificates for their respective web services
So Below are the steps to import the TSL/SSL certificate of third party
1. Open Commend prompt
2. Change path to security folder of your JDK which you are using in your project e.g. C:\Program Files\Java\jdk1.7.0_03\jre\lib\security>
3. Copy your certificates to security folder
4. Run below command to import certificate in your local truststore
keytool -importcert -alias <Alias> -file <Certificate_name.cer> -trustcacerts -keystore cacerts
e.g.
keytool -importcert -alias sagaralias -file pqr.cer -trustcacerts -keystore cacerts
5. It will ask for password and password is “changeit”
6. Certificate will get imported into your trust store and it will show you output.
Note:cacerts is the keystore provided by java.
In future many folks amongst us needs to import certificates for their respective web services
So Below are the steps to import the TSL/SSL certificate of third party
1. Open Commend prompt
2. Change path to security folder of your JDK which you are using in your project e.g. C:\Program Files\Java\jdk1.7.0_03\jre\lib\security>
3. Copy your certificates to security folder
4. Run below command to import certificate in your local truststore
keytool -importcert -alias <Alias> -file <Certificate_name.cer> -trustcacerts -keystore cacerts
e.g.
keytool -importcert -alias sagaralias -file pqr.cer -trustcacerts -keystore cacerts
5. It will ask for password and password is “changeit”
6. Certificate will get imported into your trust store and it will show you output.
Note:cacerts is the keystore provided by java.
No comments:
Post a Comment