Q : WebClient.DownloadData not working for HTTPS page through a PROXY

M

Marauderz

I'm trying to upload some data via the request headers to a page on a
secured site, the page is accessed through the office proxy.

Through IE and the appropraite proxy settings I can browse to the page just
fine.

When I use a webclient to call downloaddata on the page I get the
webexception

"The underlying connection was closed: Unable to connect to the remote
server."

which has an inner IOexception of

"The operation is not allowed on non-connected sockets."

from what I could trace out of the headers I can see that IE sets this when
requesting the page

Proxy-Connection: Keep-Alive

But when I call it through the webclient class this is set instead

Connection: Keep-Alive

I can't set the Proxy-Connection header properly since it's a protected
header, and I can't figure out how to get the WebClient to set this
particular header. Does anyone have any idea wats going on here?
 
J

Joerg Jooss

Thus wrote Marauderz,
I'm trying to upload some data via the request headers to a page on a
secured site, the page is accessed through the office proxy.

Through IE and the appropraite proxy settings I can browse to the page
just fine.

When I use a webclient to call downloaddata on the page I get the
webexception

"The underlying connection was closed: Unable to connect to the remote
server."

which has an inner IOexception of

"The operation is not allowed on non-connected sockets."

from what I could trace out of the headers I can see that IE sets this
when requesting the page

Proxy-Connection: Keep-Alive

But when I call it through the webclient class this is set instead

Connection: Keep-Alive

I can't set the Proxy-Connection header properly since it's a
protected header, and I can't figure out how to get the WebClient to
set this particular header. Does anyone have any idea wats going on
here?

What version of the .NET framework are you using? Do you explicitly use a
WebProxy instance in your code?

Cheers,
 
M

Marauderz

Damn.. thought I mentioned it.

I'm using .Net 2.0.

I've tried using both explicitly created WebProxy objects, and also
obtaining the default system proxy settings.
 
J

Joerg Jooss

Thus wrote Marauderz,
Damn.. thought I mentioned it.

I'm using .Net 2.0.

I've tried using both explicitly created WebProxy objects, and also
obtaining the default system proxy settings.

Hm... are you sure that your request is really being proxied (by checking
your proxy's logs etc.)?

Cheers,
 
M

Marauderz

Yes, other non HTTPS requests are going out fine. Same proxy settings, going
to the page with IE is fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top