Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PROXY BASIC AUTHENTICATION

843811Apr 9 2004 — edited Jun 28 2004
Hello.
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2004
Added on Apr 9 2004
3 comments
1,379 views