Recently we had an issue with one of our java applications that was trying to run an SSL protected web service of amazone load balancer,that had their certificate signed by GoDaddy. we did not Copy and paste the contents of the public key certificate chain file (PEM-encoded) in the Certificate Chain box. now we were seeing the following error:
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
. Is there a way to resolve this exception?
This error means your java keystore doesnt have ssl certificate for service you are trying to connect.
You need to add the public certificate of GoDaddy/Intermediate CA to your java keystore.
you can use keytool command for that
Related
I havekeycloakrunning inside a docker container with nginx https proxy.
Now I'm trying to connect spring boot with keycloak,
but I get an "ssl handshake" error
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
How can I add the valid certificate path to the requested target?
I tried to add a keystore and trust the certificate from keycloak inside the keystore.
But it doesn't work.
My mac has a TFS build agent connecting to a TFS server. That works fine. But when fetching the source code it fails with the following error:
An error occurred: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
When I on the mac, remove the old certificate for the TFS server from the Java Truststore I get the following error:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
If I add a new certificate for the server, into the Java truststore (the cacerts file) with good new valid time stamps, I get this error:
PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
Thus, I know that I am making changes to the correct cacerts file, since I'am getting different output based on the two scenarios above.
I've been scanning through the cacert file, trying to find if any expired cert for the TFS server is still there. Can't find any.
I've tried importing both the root cert and the site cert, but no difference there.
No problems connecting to the server site with Safari or using curl. The certificate on the server is renewed and has valid timestamps.
Any help would be greatly appreciated.
I managed to get by the issue by installing a brand new, latest version build agent.
I'm creating a micro service in Spring Boot which needs to communicate with an existing authentication service.
I have setup the OAuth configuration in Spring Boot, but I'm seeing the following error when it tries to talk to the external authentication service.
Could not fetch user details: class org.springframework.web.client.ResourceAccessException, I/O error on GET request for "https://somedomain.com/profile": 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
This appears to be because the certificate on the remote authentication service isn't valid, so it doesn't like it.
How do I resolve this?
I have tried to use openssl to download the domains certificate, and I've added this to Java's keystore, but that didn't fix the problem.
To grab and install the cert I did the following;
openssl s_client -showcerts -connect somedomain.com:443
keytool -importcert -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre/lib/security/cacerts -storepass changeit -file /Users/myuser/Downloads/plplpl.crt
I was asked if I wanted to trust the cert, I selected yes.
I am using this java library to extract GA data. But it is generating the following certificate error:
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 verified that it is trying to establish connection with url https://lhr26s05-in-f13.1e100.net which outputs a certificate error when accessed through the browser. I'm surprised this is happening as this is a google owned domain.
I have tried to manually download the certificate and add it to the cacerts file but that didn't work.
I have also tried to trust the certificate like this which has worked on other projects, but not for this one. I wonder if this is not working because I am using the google api java libraries? I'm out of ideas and would appreciate any suggestions
I have a web application deployed on Linux machine. Now, while generating pdf in web application I am getting following error:
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
It seems that ValiCert Class 3 PKI (X.509) certificate is missing in jre's keystore. Does anyone have an idea of how to download it on Linux? Please provide the steps or link where I can get the required information?
Thnaks in advance!