SSLHandshakeException: When trying trying to access a HTTPS URL

I was trying to access a HTTPS URL using java.net.HttpURLConnection and got following error. 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 Most of the time, this exception occurs when you are using selfsigned certificate. Reason:  The host that you are trying to connect has an … Continue reading SSLHandshakeException: When trying trying to access a HTTPS URL