java.net.http.HttpClient do NOT support Digest authentication while HttpURLConnection do
Farkas Levente
lfarkas at lfarkas.org
Thu Apr 28 22:40:36 UTC 2022
Hi,
Even though many tutorial said that the new java.net.http.HttpClient
support Digest authentication it's not true:
https://github.com/openjdk/jdk/blob/master/src/java.net.http/share/classes/jdk/internal/net/http/AuthenticationFilter.java#L278
But at the same time HttpURLConnection support it through the simple:
-------------------------------
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication (
"username",
"password".toCharArray()
);
}
});
-------------------------------
Is it a bug or you don't even plan to support it with HttpClient?
Regards.
--
Levente "Si vis pacem para bellum!"
More information about the core-libs-dev
mailing list