| Author |
HttpsURLConnection Proxy auth problem
|
Andreas Niemeyeer
Greenhorn
Joined: Dec 13, 2005
Posts: 2
|
|
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
|
 |
Andreas Niemeyer
Greenhorn
Joined: Dec 13, 2005
Posts: 4
|
|
Dear all, I solved the problem by reading this thread: https://cis.med.ucalgary.ca/http/forum.java.sun.com/thread.jspa?threadID=188930&tstart=45 and use now this great package: http://jakarta.apache.org/commons/httpclient :-) Thanks for your attention, Andreas
|
 |
 |
|
|
subject: HttpsURLConnection Proxy auth problem
|
|
|