I'm trying to use password authentication if a proxy requires it for Java's Native HTTP Client requests.
I have tried a bunch of stuff, with the most common solution applied to my program being
String username = "username";
String password = "password";
Authenticator.setDefault( new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password.toCharArray());
}
});
But after that I'm still getting error 407 when sending the request (which works fine on an IP Authenticated proxy). The proxy works just fine on a browser running it through a Chrome extension.