Details
-
Bug
-
Resolution: Not an Issue
-
P3
-
8, 9
-
None
Description
==================================SAMPLE CODE ==========================================
import java.net.*;
import java.io.*;
public class HttpSample {
public static void main(String[] args) throws Exception {
URL test = new URL("https://api.whichbrowser.net");
URLConnection yc = test.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
==================================SAMPLE CODE ==========================================
Exception in thread "main" 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:198)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1948)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:309)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:303)
at sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1841)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1650)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:260)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1003)
at sun.security.ssl.Handshaker.processRecord(Handshaker.java:937)
at sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1118)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1055)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:966)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1381)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1408)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1392)
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:1511)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:235)
at HttpSample.main(HttpSample.java:14)
import java.net.*;
import java.io.*;
public class HttpSample {
public static void main(String[] args) throws Exception {
URL test = new URL("https://api.whichbrowser.net");
URLConnection yc = test.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
==================================SAMPLE CODE ==========================================
Exception in thread "main" 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:198)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1948)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:309)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:303)
at sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1841)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1650)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:260)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1003)
at sun.security.ssl.Handshaker.processRecord(Handshaker.java:937)
at sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1118)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1055)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:966)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1381)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1408)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1392)
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:1511)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:235)
at HttpSample.main(HttpSample.java:14)
Attachments
Issue Links
- blocks
-
JDK-8159698 Blank page while loading att.com in Webview (Due to javax.net.ssl.SSLHandshakeException)
- Closed
- duplicates
-
JDK-8150657 HTML5 testsuite doesn't work
- Closed
-
JDK-8159698 Blank page while loading att.com in Webview (Due to javax.net.ssl.SSLHandshakeException)
- Closed
- is cloned by
-
JDK-8209973 ValidatorException thrown while connecting to https://google.com
- Closed