JDK-8210002 : JDK 11 fails to connect to www.googleapis.com
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 11
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2018-08-26
  • Updated: 2018-08-28
  • Resolved: 2018-08-28
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
Request works in JDK10, but fails in JDK11

REGRESSION : Last worked in version 11

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run jshell, use java.net.httpclient

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Returns response for http request
ACTUAL -
Fails to connect

---------- BEGIN SOURCE ----------
$ /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/jshell
|  Welcome to JShell -- Version 11-ea
|  For an introduction type: /help intro

jshell> import java.net.URI;

jshell> import java.net.http.HttpClient;

jshell> import java.net.http.HttpRequest;

jshell> import java.net.http.HttpResponse;

jshell>

jshell> import static java.net.http.HttpResponse.BodyHandlers.ofString;

jshell>         HttpClient client = HttpClient.newHttpClient();
client ==> jdk.internal.net.http.HttpClientImpl@55040f2f(1)

jshell>         HttpRequest request = HttpRequest.newBuilder().uri(URI.create("https://www.googleapis.com/robots.txt")).build();
request ==> https://www.googleapis.com/robots.txt GET

jshell>         client.sendAsync(request, ofString()).thenApply(HttpResponse::body).thenAccept(System.out::println).join();
|  Exception java.util.concurrent.CompletionException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
---------- END SOURCE ----------

FREQUENCY : always



Comments
The submitter has confirmed back that this is working in JDK 11-ea+28. Closing this as duplicate of JDK-8209506 .
28-08-2018

To submitter: The bug report did not tell which 11-ea build have you tested with. I have tried with JDK 11-ea + 28 and it worked fine for me. There was a fix in build 27 (JDK-8209506) , which I suppose has fixed the issue you are observing. So , can you please verify with the latest JDK 11 build and confirm back.
27-08-2018

To submitter : I am not able to reproduce the issue described in bug report. Attached is the test case and output log. Can you send across the logs with -Djava.security.debug=certpath and ���Djavax.net.debug=all enabled.
27-08-2018