Home All Groups Group Topic Archive Search About

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

Author
3 Jan 2007 7:23 AM
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?

Author
3 Jan 2007 11:16 AM
Joerg Jooss
Thus wrote Marauderz,

Show quote
> 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,
--
Joerg Jooss
news-re***@joergjooss.de
Author
3 Jan 2007 6:37 PM
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.

Show quote
"Joerg Jooss" <news-re***@joergjooss.de> wrote in message
news:94fc5071600698c8fd48189a9a14@msnews.microsoft.com...
> 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, --
> Joerg Jooss
> news-re***@joergjooss.de
>
>
Author
6 Jan 2007 11:54 AM
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,
--
Joerg Jooss
news-re***@joergjooss.de
Author
9 Jan 2007 4:14 AM
Marauderz
Yes, other non HTTPS requests are going out fine. Same proxy settings, going
to the page with IE is fine.
Show quote
"Joerg Jooss" <news-re***@joergjooss.de> wrote in message
news:94fc507160b468c8ffa8f9402978@msnews.microsoft.com...
> 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,
> --
> Joerg Jooss
> news-re***@joergjooss.de
>
>

AddThis Social Bookmark Button