Caused by: 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 am trying to run a report but it throws the following error. My JasperReportServer is running on Docker and the docker is running on a remote server. Here is the error code:

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: 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 com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:551)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:526)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:444)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: 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 net.sf.jasperreports.data.http.HttpDataConnection.getInputStream(HttpDataConnection.java:101)
    at net.sf.jasperreports.data.DataFileStream.<init>(DataFileStream.java:47)
    at net.sf.jasperreports.data.DataFileUtils.getDataStream(DataFileUtils.java:79)
    at net.sf.jasperreports.data.json.JsonDataAdapterService.contributeParameters(JsonDataAdapterService.java:75)
    at net.sf.jasperreports.engine.fill.JRFillDataset.contributeParameters(JRFillDataset.java:1153)
    at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:665)
    at net.sf.jasperreports.components.list.FillDatasetRun.start(FillDatasetRun.java:164)
    at net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:102)
    at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152)
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:542)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:453)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:428)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2585)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)
    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)
    at java.lang.Thread.run(Thread.java:748)
Caused by: 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:1959)
    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:1514)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:961)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.BasicHttpClientConnectionManager.connect(BasicHttpClientConnectionManager.java:313)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:394)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at net.sf.jasperreports.data.http.HttpDataConnection.getInputStream(HttpDataConnection.java:67)
    ... 18 more
Caused by: 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.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:302)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
    ... 38 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:392)
    ... 44 more

What might be the issue? I am not finding anything useful from google. Please help me figure this out. THanks

jamshaidiqbal120's picture
Joined: Nov 25 2019 - 11:04am
Last seen: 11 hours 46 min ago

3 Answers:

The error: unable to find valid certification path to requested target

SSL access problem.

Probably something from app server accessing somewhere with invalid SSL certificate.

Mariano

mlopez_1's picture
2869
Joined: Oct 21 2013 - 8:08am
Last seen: 2 days 14 hours ago

@mlopez_1 would you please give some hints how do I figure that out? thanks a lot. do I need to look into the configuration of jasperserver or something else?

jamshaidiqbal120's picture
Joined: Nov 25 2019 - 11:04am
Last seen: 11 hours 46 min ago

The best thing you can do is to ask someone who knows app server internal configurations.

It's systems problems, not Jasperserver problems, I think.

Mariano

mlopez_1's picture
2869
Joined: Oct 21 2013 - 8:08am
Last seen: 2 days 14 hours ago
Feedback
randomness