PROXY BASIC AUTHENTICATION
843811Apr 9 2004 — edited Jun 28 2004Hello.
I'm facing problem during client connection throungth proxy.
The error messagge is:
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 302 Moved Temporarily"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:923)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA6275)
at updateAuto.getInputStream(updateAuto.java:494)
at updateAuto.downloadFile(updateAuto.java:422)
at updateAuto.start(updateAuto.java:263)
at Avvio.main(Avvio.java:8)
The question is: how i set the basic authentication? I found two example:
URL url= new URL(fileName);
URLConnection connection= url.openConnection();
connection.setRequestProperty("Proxy-Authorization","Basic " + new sun.misc.BASE64Encoder().encode(proxyUser + ":" + proxyPassword).getBytes()));
URL url= new URL(fileName);
URLConnection connection= url.openConnection();
connection.setRequestProperty("Proxy-Authorization", new sun.misc.BASE64Encoder().encode(proxyUser + ":" + proxyPassword).getBytes()));
So, i MUST specify the Basic before the user-password or not?
I'm in the rigth direction or i miss something?
Best regards
Gianluca Chiodaroli