Security http connection(HTTPS) failed: Unable to tunnel through proxy.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhang_joachimz
Posted On:   Thursday, October 9, 2003 08:37 PM

Error: java.io.IOException: Unable to tunnel through 10.131.110.60:3128. Proxy returns "HTTP/1.1 200 Connection established" My proxy is authenticate by IP(not via user/password), and can work well for normal http url. I'm a new comer for TCP and https. Does my proxy not support HTTPS or something I'v miss? Pls give me a hand! following is my test java code fragment¡£ final String proxyHost= "10.131.110.60"; final String proxyPort= "3128"; final String userName= null; final String password= null; System.setProperty("https.proxyHost", proxyHost); System.setProperty("https.proxyPort&qu   More>>
Error: java.io.IOException: Unable to tunnel through 10.131.110.60:3128. Proxy returns "HTTP/1.1 200 Connection established"


My proxy is authenticate by IP(not via user/password), and can work well for normal http url.


I'm a new comer for TCP and https. Does my proxy not support HTTPS or something I'v miss? Pls give me a hand!


following is my test java code fragment¡£


			
final String proxyHost= "10.131.110.60";
final String proxyPort= "3128";
final String userName= null;
final String password= null;

System.setProperty("https.proxyHost", proxyHost);
System.setProperty("https.proxyPort", String.valueOf(proxyPort));

System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", String.valueOf(proxyPort));

if (userName != null)
{
Authenticator.setDefault(new Authenticator()
{
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(
userName,
password == null
? new char[0]
: password.toCharArray());
}
});
}
// prepare https
System.setProperty(
"java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
java.security.Security.addProvider(
new com.sun.net.ssl.internal.ssl.Provider());

try
{
URL url=
new URL("https://webwork.dev.java.net/source/browse/webwork/src/");
ByteArrayOutputStream bbs = new ByteArrayOutputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
}
catch (Exception e)
{
e.printStackTrace();
}



Error stack as follow:


			
java.io.IOException: Unable to tunnel through 10.131.110.60:3128. Proxy returns "HTTP/1.1 200 Connection established"
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.doConnect([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.NetworkClient.openServer([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.l([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpClient. ([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient. ([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect([DashoPro-V1.2-120198])
at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream([DashoPro-V1.2-120198])
at java.net.URL.openStream(URL.java:793)
............
   <<Less

Re: Security http connection(HTTPS) failed: Unable to tunnel through proxy.

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, October 10, 2003 03:10 PM

Typically your proxy will have a different port, for https...

About | Sitemap | Contact