PC Review


Reply
Thread Tools Rate Thread

Accepting Certificates

 
 
=?Utf-8?B?QmVuIFBoaXBwcw==?=
Guest
Posts: n/a
 
      17th Aug 2005
I'm attempting to make a secure connection to wesite using a HttpWebRequest
with a "https:" uri. However, attempting to get the response fails because
the trust relationship has not been established. Namely, the issuing
certificate authority is not on the list of trusted authorities. What I
can't figure out is how to accept the certificate and reissue the request,
even accepting all certificates would be fine as I'm just trying to get this
thing working. Can anyone out there help me?
 
Reply With Quote
 
 
 
 
Nicole Calinoiu
Guest
Posts: n/a
 
      19th Aug 2005
Permanently accepting a new root CA is a decision that really ought to
involve deliberate human intervention, and I wouldn't recommend that you add
this to your application. However, if an untrusted root CA should not
prevent the use of https in your application, you may want to consider
creating a custom implementation of the System.Net.ICertificatePolicy
interface for use as the System.Net.ServicePointManager.CertificatePolicy.
(Taken
together, the MSDN topics for the ICertificatePolicy interface and the
CertificatePolicy property form a sample of the technique.)

Even this more limited approach is potentially quite dangerous, and I
wouldn't recommend it, but it does pose less overall risk than blindly
trusting an unknown CA...




"Ben Phipps" <(E-Mail Removed)> wrote in message
news:B1DD3978-E289-4C4C-A7A0-(E-Mail Removed)...
> I'm attempting to make a secure connection to wesite using a
> HttpWebRequest
> with a "https:" uri. However, attempting to get the response fails
> because
> the trust relationship has not been established. Namely, the issuing
> certificate authority is not on the list of trusted authorities. What I
> can't figure out is how to accept the certificate and reissue the request,
> even accepting all certificates would be fine as I'm just trying to get
> this
> thing working. Can anyone out there help me?



 
Reply With Quote
 
shriop
Guest
Posts: n/a
 
      22nd Aug 2005
Create this class

public class TrustedCertificatePolicy : ICertificatePolicy
{
public TrustedCertificatePolicy()
{
}

public bool CheckValidationResult(ServicePoint sp, X509Certificate
certificate, WebRequest request, int problem)
{
return true;
}
}

then somewhere in your calling code, put this

ServicePointManager.CertificatePolicy = new TrustedCertificatePolicy();

Bruce Dunwiddie
http://www.csvreader.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accepting Changed Paragraph Numbers Without Accepting Other Change Jerry Microsoft Word Document Management 1 15th Jan 2010 04:01 AM
Certificates console snap-in not displaying certificates installed on server danofames@gmail.com Microsoft Windows 2000 0 4th Jan 2007 03:22 PM
Certificates of Achievement or Training Certificates etc =?Utf-8?B?Qm9i?= Microsoft Word Document Management 0 28th Jan 2005 03:35 PM
HttpWebRequest lockup while posting to a site 'accepting client certificates' B Martin Microsoft Dot NET Framework 4 20th Jan 2005 02:12 AM
accepting self-signed pop3s server certificates No Whereman Microsoft Outlook 3 12th Oct 2004 04:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:07 PM.