472,958 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

WebProxy + SSL

Hi, all

I have a problem of the following kind.

There's a remote server that can be accessed via HTTPS (say,
https://remoteserver). This server doesn't allow anonymous users, so I have
to connect to it using some username/password.

There's a .NET client that must access this remote server and this client
can go to the Internet only through Proxy Server. This Proxy Server doesn't
require authentication.

And now what happens: .Net client doesn't work properlym receiving
401-Unauthorized while trying to connect to remote server.


1. Running IE from the same client machine (and using the same Proxy
Server), user can connect to remote server just fine
2. If .NET client is configured to bypass proxy server, it can connect to
remote server just fine
3. .NET client can connect (via Proxy Server) to the same remote server via
4. .NET client can connect (via Proxy Server) to any other https site if it
allows anonymous access.

Taking above into account, it seems that the problem is with passing the
credentials through Proxy Server. Does anyone have ideas?

Now here's the code:

string url = "https://remoteserver";
string proxyurl = "some.proxyserver.url:8080";
NetworkCredential c = new NetworkCredential("user", "password", "domain");
WebProxy p = new WebProxy(proxyurl, false);
p.Credentials = CredentialCache.DefaultCredentials;
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Proxy = p;
req.Credentials = c;
req.PreAuthenticate = true;
req.KeepAlive = true;
using(HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
catch(Exception ex)

May 8 '06 #1
0 1137

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Jim Douglas | last post by:
I have a requirement to dynamically create a webProxy object in C#. I have created an instance of the webProxy and stored it within a hashtable then placing the hashtable in cache. When required I...
by: Ricardo Luceac | last post by:
I need to use a Proxy to use a webrequest object, but the proxy is not a URI, is a ip address and a port number... How can I create the WebProxy object??? Or use the proxy in other way??? ...
by: vooose | last post by:
Consider accessing a webpage through a proxy server: WebRequest request = WebRequest.Create("http://somepage.com"); WebProxy proxy = new WebProxy(proxyHost, proxyPort); proxy.Credentials = new...
by: Sam Santiago | last post by:
I am using the WebProxy.GetDefaultProxy() function to read the IE settings, but it's returning an empty WebProxy object. Are there any known reasons why this is not reading the proxy settings in IE...
by: Michael S. Scherotter | last post by:
I am building a C# desktop application in .Net 1.1 that consumes web services. I use System.Net.WebProxy.GetDefaultProxy() to get the proxy settings from IE but I get reports from people who are...
by: Andrew | last post by:
Morning everybody, I have an XML document located on a web address and I wish to create a C# program to read that XML document and process it - which shouldn't be that difficult yet I'm running...
by: John A Grandy | last post by:
I am always RAS'd into MS CorpNet VPN under my REDMOND account. I am always able to ping "itgproxy.redmond.corp.microsoft.com" I instantiate a System.Net.WebProxy object as follows: using...
by: djc | last post by:
I see many ways to accomplish setting up proxy settings for a web request in the documentation but many of them are marked as obsolete. 1) What is the current and correct way to tell all my...
by: =?Utf-8?B?TXJOb2JvZHk=?= | last post by:
I found an example online and when I tried repeating it with the proxy I normally use for my browser, I get errors. What I do is this: WebProxy proxy = new...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.