Andreas Niemeyeer

Greenhorn
+ Follow
since Dec 13, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andreas Niemeyeer

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
Hi

I found the bug about sending a `kill -3 ProcID' - dump a stack
trace. The most number of stacks are the same(see below)

A `java.util.zip.ZipInputStream.getNextEntry(Unknown Source)' exception causes a hanging ssl socket though no clients are connected.

A netstat -p shows me a huge number of established connections bounded to the process.

I fixed the code by catching this exception, all works fine now.

Cheers,
Andreas



2. in the ComServerDataThread:
"45" prio=1 tid=0x08367d30 nid=0x13eb runnable [50a79000..50a798b8]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
- locked <0x44faba20> (a java.lang.Object)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
- locked <0x44faba78> (a com.sun.net.ssl.internal.ssl.AppInputStream)
at java.io.FilterInputStream.read(Unknown Source)
at java.io.PushbackInputStream.read(Unknown Source)
at java.util.zip.ZipInputStream.readFully(Unknown Source)
at java.util.zip.ZipInputStream.readLOC(Unknown Source)
at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
at com.XXX.YYY.prog.thread.ComServerDataThread.receiveData(ComServerDataThread.java:215)
at com.XXX.YYY.prog.thread.ComServerDataThread.run(ComServerDataThread.java:120)