HI. I have a Java application that communicates with an https server but recently stopped working. The basis of the code is that it tries to open a URL to https://.... and then spits out this handshaking 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 understand this looks like a problem with keystores, however the following makes me believe this isn't the case...
1. This same code works on another linux server and a windows machine where no keystore has ever been set up
2. When I replace the URL in my code with another https URL it works fine without having to setup any keystore
3. I can telnet to and open the URL on the server - it's only Java which fails to communicate with it
It is possible someone in the past has set a keystore on this machine
This isn't the exact code from my application but I have reduced it to this basic statement which gives the same exception:URL url = new URL("https://www.server.co.uk");System.out.println(url.getContent());I have replaced the actual URL with this dummy one