Link to home
Start Free TrialLog in
Avatar of Mithrinder
Mithrinder

asked on

Security Certificate & .NET

Hi all,

I sometimes use a web debugging tool to check the URL GET strings.  When using it with Explorer directly it will raise a security alert window with:

 "Information you exchange with this site can not be viewed or changed by others.  However there is a problem with the site's security certificate."

"The security certificate was issued by a company you have chose not to trust.  View the certificate to determine whether you want to trust the certifying authority."

"The security certificate date is valid."

"The security certificate has a valid name matching the name of the page you are trying to view"

It then asks if it is ok to proceed

The web tool provides the certificate but I have chosen not to install it in the "Trusted Root Certification Authorities" instead I just choose yes when I need to use it and explorer proceeds on ahead and I can then check what is sent to the server for accuracy.

I would like to be able to do this also with .NET, I have an application that uses the HttpWebRequest/HttpWebResponse classes.  Is there some where I can set a value in the httpwebrequest class that does the same thing as hitting the "yes" button with explorer or do I need to add the web tool's certificate to the "Trusted Root Certification Authorities"?

If I use the web tool with the .NET app currently I get an exception from System.Net.WebException with the message:
"The underlying connection was closed: Could not establish trust relationship with remote server."

Thanks for any help you can give me.
ASKER CERTIFIED SOLUTION
Avatar of gregasm
gregasm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mithrinder
Mithrinder

ASKER

Hello Greg,

Thanks Thanks Thanks...Added that code and it did the trick now I can see the strings I am sending out.

Mithrinder