Dear all,
I want to do a https request with an proxy and authorisation.
Here an example code and values (the user/pass is correct):
String vProxy = "localproxy";
String vProxyPort = "80";
String vProxyUser = "user";
String vProxyPass = "pass";
System.setProperty("https.proxyHost", vProxy);
System.setProperty("https.proxyPort", vProxyPort);
URL vURL = new URL("https://www.google.com:443/");
HttpsURLConnection vCon = (HttpsURLConnection) vURL.openConnection();
String vAccount = vProxyUser + ":" + vProxyPass;
String vEncodedAccount = new sun.misc.BASE64Encoder().encode(vAccount.getBytes());
vCon.setRequestProperty("Https-Proxy-Authorization", "Basic "+encodedAuth);
vResponseCode = vCon.getResponseCode();
vResponseMessage = vCon.getResponseMessage();
The response message is always `Proxy Authentication Required'.
Has anyone the same problem solved? Might it be a digest auth scheme or another thing?
Thank you in advance,
Andreas