users
[Top] [All Lists]

Java Browser -- proxy, authentication, and https

To: <users@xxxxxxxxxx>
Subject: Java Browser -- proxy, authentication, and https
From: "Hudson, Loren (GE Infra, Aviation, Non-GE, US)" <loren.hudson@xxxxxx>
Date: Wed, 12 Sep 2007 13:02:47 -0400
Delivered-to: mailing list users@xxxxxxxxxx
In-reply-to: <46D77CD3.8000705@xxxxxxxxxxx>
Mailing-list: contact users-help@xxxxxxxxxx; run by ezmlm
Thread-index: Acfrd3W6gE2dlnf8TCe91gy67yAqtwJ5OrzA
Thread-topic: Java Browser -- proxy, authentication, and https
Ladies and Gentlemen,
 
The reason I have to do this is really ... dumb, but I still have to do it.
 
I'm trying to implement a browser in java which I can use to programmatically download content from an http server.  Doesn't sound so hard yet, does it? 
 
The trick is that at my client, I am behind a proxy to which I must authenticate.  Again, not so hard.  Aggravating, but not difficult in that I can download all of the code I need off of the internet.
 
The tricky part is using https.  The code and help on the internet doesn't seem to be helping.  Do any of you have experience with this?  The https proxy is at the same ip and port as the http proxy, but for some reason, when I turn on the https, I get a "400 Bad Request" error.
 
Here's the trail as provided by Eclipse

java.io.IOException

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:593)

at com.internal.browser.Browser.run(Browser.java:67)

at com.internal.browser.SecureBrowser.main(SecureBrowser.java:14)

Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://internal-proxy.com:80https://external-server.com/ReverseProxy/Authentication.html

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)

at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey(HttpURLConnection.java:1490)

at com.internal.browser.Browser.run(Browser.java:60)

... 1 more

If you want to see the code, I can scrub and provide that on an individual basis.
 
Thanks,
<Prev in Thread] Current Thread [Next in Thread>