A DESCRIPTION OF THE PROBLEM : In jdk.internal.net.http.common.Utils, the code says: public static final BiPredicate<String, String> CONTEXT_RESTRICTED(HttpClient client) { return (k, v) -> client.authenticator() == null || ! (k.equalsIgnoreCase("Authorization") && k.equalsIgnoreCase("Proxy-Authorization")); } But client.authenticator() returns an Optional and thus cannot be null. This has been fixed in master by the following code: public static final BiPredicate<String, String> CONTEXT_RESTRICTED(HttpClient client) { return (k, v) -> client.authenticator().isEmpty() || ! (k.equalsIgnoreCase("Authorization") && k.equalsIgnoreCase("Proxy-Authorization")); } But unfortunately the code hasn't been backported to JDK 11 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Try to implement proxy authentication using JDK 11 HttpClient EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Proxy Authentication should work ACTUAL - Proxy Authentication doesn't work
|