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...
> I'm attempting to make a secure connection to wesite using a
> HttpWebRequest
[quoted text clipped - 6 lines]
> this
> thing working. Can anyone out there help me?
shriop - 22 Aug 2005 06:30 GMT
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