2

We have an application hosted on intranet and we are trying to configure Azure SSO for the same. The login page is getting redirected to Microsoft login portal and we are receiving the authorization Code. But when we try to post a request back to Microsoft to gain the token, we get this particular error.

**sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
   at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)**

We have placed the certificates by downloading them from the browser and importing them into jdk/jre/lib/security/cacerts as well. Web proxy has been enabled to access internet. We are running out of ideas to get a resolution. Any help would be appreciated.

Sumit Mishra
  • 21
  • 1
  • 1
  • 2

1 Answers1

0

It seems like many users have similar questions about PKIX path building failed: SunCertPathBuilderException: unable to find valid certification path to requested target, here is really high scored answer: https://stackoverflow.com/a/36427118/1595293

Based on: https://magicmonster.com/kb/prg/java/ssl/pkix_path_building_failed/

Luke Duda
  • 904
  • 9
  • 12
  • it seems the root certificate is already present in cacerts. And regarding the certification import thing, we have downloaded and imported the certificate into cacerts inside jdk/jre/lib/security but still did not have any luck resolving the issue – Sumit Mishra Jul 10 '20 at 13:04
  • 2
    Hello @SumitMishra Have you checked this solution : https://www.techsupper.com/2017/11/javax-net-ssl-sslhandshakeexception-sun-security-validator-validatorexception-pkix-path-building-failed.html ? Please let me know if this solution doesnt resolve your issue. – Nishant Jul 10 '20 at 13:59
  • Please let us know if this answer was helpful to you. If so, please remember to mark it as the answer using the check mark so that others in the community with similar questions can more easily find a solution. Also, Please spare few mins to let us know how we did using this link – Nishant Aug 05 '20 at 22:00