2
votes

I am running a Spring Boot application in Docker with Kubernetes.

While downloading an image I am getting the below error:

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

How can I solve this problem?

2
Have you tried adding the certificate to the docker image and installing them via keytool - Lesiak
@Lesiak :: Thanks. I just installed certificate to the docker and it is working fine now - Hearaman
In this case, I'll post my advice as an answer - Lesiak

2 Answers

3
votes

Try adding the certificates to the docker image and installing them via keytool

1
votes

After adding certificate to the docker now i am able to access the remote site.

Assure I need to download files or access abc.com over https

Add below lines to your Docker file

 USER root
 RUN cd $JAVA_HOME/lib/security && echo -n | openssl s_client -connect abc.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > abc.com.crt &&  keytool -keystore cacerts -keypass changeit -storepass changeit -noprompt -import -v -trustcacerts -alias abc.com -file abc.com.crt