Java 找不到请求的目标协议https的有效证书路径
文件路径采用了Https协议,我的代码是 URL链接=新URL(文件路径)强> InputStream in=new BufferedInputStream(link.openStream())强> 我正在使用jdk1.8.0_211Java 找不到请求的目标协议https的有效证书路径,java,spring,spring-boot,ssl-certificate,sslhandshakeexception,Java,Spring,Spring Boot,Ssl Certificate,Sslhandshakeexception,文件路径采用了Https协议,我的代码是 URL链接=新URL(文件路径) InputStream in=new BufferedInputStream(link.openStream()) 我正在使用jdk1.8.0_211 你能分享一下你是如何在这里存储文件路径的吗?记住在这里总是以文本形式提供错误消息(或者可能只是其中的相关部分),而不是错误消息的屏幕截图。文件路径是一个带有https协议的Url。你在这里尝试过答案吗?感谢您,它可以通过选项1从这个链接工作 javax.net.
你能分享一下你是如何在这里存储文件路径的吗?记住在这里总是以文本形式提供错误消息(或者可能只是其中的相关部分),而不是错误消息的屏幕截图。文件路径是一个带有https协议的Url。你在这里尝试过答案吗?感谢您,它可以通过选项1从这个链接工作
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:1946)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1639)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
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.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at java.net.URL.openStream(URL.java:1045)
at com.km.app.web.service.ImprimanteService.print(ImprimanteService.java:32)
at com.km.app.web.controller.ImprimanteController.print(ImprimanteController.java:43)