Liferay 7.2 REST API related SunCertPathBuilderException.Liferay 7.2 REST API related SunCertPathBuilderException.https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1194805162024-03-28T12:10:22Z2024-03-28T12:10:22ZRE: Liferay 7.2 REST API related SunCertPathBuilderException.harika suramhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1194853892020-06-25T12:16:06Z2020-06-25T12:16:06ZThank you so much.I found its some project internal badge issue for SSL certificate which i need to add.This is almost the 5th time that i resolved my issues only because of the replies i got from liferay team.Especially liferay DXP issues <strong>Liferay forums</strong> is the only hope. Finally resolved.Thank you.harika suram2020-06-25T12:16:06ZRE: Liferay 7.2 REST API related SunCertPathBuilderException.Christoph Rabelhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1194825432020-06-25T08:29:17Z2020-06-25T08:29:17ZJust to clarify my assumptions:<br />You have a Liferay server which is configured to use SSL (either directly in Tomcat or using an Apache reverse proxy). You have a client application that tries to access that server.<br />Do you have a self signed certificate in your server? Than you need to import the relevant root certificate in the certstore of your client.<br />If you have bought a certificate from some vendor, you can have either misconfigured it in the server e.g. by forgetting to add the intermediate certificate to complete the chain (there are online tests for that, if your server is in the internet, you can test e.g. with https://www.ssllabs.com/ssltest/ , something I would recommend to do anyway!). I am sure, there are other test tools out there.<br />If the server is fine, you probably have a certificate chain issue in the client. Maybe the certificate store is not up to date and doesn't recognize your vendor.<br />Since there are many paths that lead to that error, you need to narrow it down to get better hints.Christoph Rabel2020-06-25T08:29:17ZLiferay 7.2 REST API related SunCertPathBuilderException.harika suramhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1194805152020-06-24T19:16:22Z2020-06-24T19:16:22ZHi,<br />I created REST API in liferay 7.2I tried to call the API using .<br /><br />byte[] encodedAuth = Base64.encodeBase64(<br /> auth.getBytes(StandardCharsets.ISO_8859_1));<br /> String authHeader = "Basic " + new String(encodedAuth);<br /> <br /> HttpGet get = new HttpGet(url);<br /> get.setHeader(HttpHeaders.AUTHORIZATION, authHeader); <br /> get.setHeader("Content-Type", "application/x-www-form-urlencoded");<br /> <br /> HttpClient client = HttpClientBuilder.create().build(); HttpResponse response = client.execute(get);<br /><br />I am getting this error. Could you please help me how to resolve the issue.<br /><br /><br />2020-06-24 11:22:46.895 ERROR [ajp-nio-8009-exec-10][render_portlet_jsp:131] null<br />sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target<br /> at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)<br /> at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)<br /> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)<br /> at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:445)<br /> at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:317)<br /> at sun.security.validator.Validator.validate(Validator.java:262)<br /> at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:330)<br /> at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:227)<br /> at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)<br /> at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1671)<br /> at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:226)<br /> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1082)<br /> at sun.security.ssl.Handshaker.process_record(Handshaker.java:1010)<br /> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1079)<br /> at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388)<br /> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416)<br /> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400)<br /> at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)<br /> at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.jav