Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2004

Tip: Looking for answers? Try searching our database.

Problem with HTTPS and Proxy Servers using Net Framework 1.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dzc55g - 04 May 2004 09:56 GMT
Problem:  Attempting to return https web page via a proxy server not working in .NE

Platform: Windows 2000 SP4, Visual Studio .NET 2003, .NET Framework 1.

The following code returns

An unhandled exception of type 'System.Net.WebException' occurred in system.dl

Additional information: The underlying connection was closed: Unable to connect to the remote server

Code

HttpWebRequest HttpWReq  = (HttpWebRequest)WebRequest.Create("https://webaddress.com")

WebProxy wp = new WebProxy("proxyaddress", 443);   
       
wp.Credentials = new NetworkCredential("username","password")
HttpWReq.Proxy = wp

// Turn off connection keep-alives
HttpWReq.KeepAlive = false

HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse()

The code above seems to work fine on the following configuration

Windows XP, .NET Framework 1.
Windows 2000 SP3, .NET Framework 1.

However it does not work on

Windows XP, .NET Framework 1.

If I change the code to request a standard http page (e.g. http://google.co.uk) and change the port number to 80 the code works fine

Is there some version or security issue I am not aware of
Is this a known issue with 1.1 of the .NET Framework
Is there an alternative method in .NET
Paul Glavich [MVP - ASP.NET] - 04 May 2004 13:52 GMT
I've only seen this happen when Keep-alives are used. I can see in the code
you are disabling this but have you checked the Http headers to verify this
is the case. Also, try disabling them on the server.

--
- Paul Glavich
Microsoft MVP - ASP.NET

> Problem:  Attempting to return https web page via a proxy server not working in .NET
>
[quoted text clipped - 34 lines]
> Is this a known issue with 1.1 of the .NET Framework.
> Is there an alternative method in .NET?
Feroze [MSFT] - 11 May 2004 01:22 GMT
What kind of proxy server do you have ? Is it a HTTP proxy ?

If you are just using a http proxy to tunnel HTTPS request, then you should
just set

   WebProxy wp = new WebProxy("proxyaddress", 80)

instead of

   WebProxy wp = new WebProxy("proxyaddress", 443)

Signature

feroze
http://weblogs.asp.net/feroze_daud
============

Remove "user" from the email address to reply to the author.

This posting is provided "AS IS" with no warranties, and confers no rights

Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Problem:  Attempting to return https web page via a proxy server not working in .NET
>
[quoted text clipped - 34 lines]
> Is this a known issue with 1.1 of the .NET Framework.
> Is there an alternative method in .NET?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.