2

I am calling a web service and recently I have received the three .CER files for getting the production server access. My web service is working fine in development server and I already have trust(.jks) and keyStore(.p12) files in my workspace. what should I need to do with .CER files. While accessing the production URL I am getting below exception:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Please suggest.

Rohit
  • 445
  • 2
  • 7
  • 17
  • 1
    It is hard to say without more information about what is in those `.cer` files. Taking a stab in the dark I would say put them in the truststore, but that only makes sense if they contain self-signed certificates for your server. But then why are there three files? –  Nov 20 '13 at 01:32

1 Answers1

0

You need to add the certificate to the keystore file of the used JVM located at %JAVA_HOME%\lib\security\cacerts.

First you can check if your certificate is already in the keystore by running the following command: keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts" (you don't need to provide a password)

If your certificate is missing you can get it by downloading it with your browser and add it to the keystore with the following command:

keytool -import -noprompt -trustcacerts -alias -file -keystore -storepass

source

Community
  • 1
  • 1
grepit
  • 21,260
  • 6
  • 105
  • 81