0
votes

I am using spring-cloud-config in my spring boot project but when I try to run my application as spring boot app it is giving following exception

Could not locate PropertySource: I/O error on GET request for "https://spring-cloud-config-orgname.com/annuity-application-api/dev/master": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I have added certificate in java truststore using following command

keytool -importcert -trustcacerts -file C:\Users\patilp1\temp\sslcerts\spring-cloud-config.cer -alias "spring-cloud-config"

Still my application is giving same exception. Any idea what would be the reason behind this as I have already added certificate in my java truststore located at

C:\Program Files\Java\jdk1.8.0_192\jre\lib\security

1

1 Answers

0
votes

Try this: 1. Create a keystore/truststore with your config server's certificate in it 2. Add following VM Arguments:

-Djavax.net.ssl.keyStore=<location of your keystore>
-Djavax.net.ssl.keyStorePassword=<your storepass>
-Djavax.net.ssl.trustStore=<location of your truststore>
-Djavax.net.ssl.trustStorePassword=<your storepass>
-Djavax.net.ssl.trustStoreType=jks

Hope this helps.