I have added the following class to my code for consuming a webservice. I
want to be able to accept all certificates for testing etc..
public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
{
public TrustAllCertificatePolicy()
{}
public bool CheckValidationResult(ServicePoint sp,
X509Certificate cert,WebRequest req, int problem)
{
return true;
}
}
However, when I try to build the application, I get the build error:
'TrustAllCertificatePolicy' does not implement interface member
'System.Net.ICertificatePolicy.CheckValidationResult(System.Net.ServicePoint
, System.Security.Cryptography.X509Certificates.X509Certificate,
System.Net.WebRequest, int)'
Any ideas?
Thanks,
Stewart Bourke
Perhaps a bit more info would be in order:
vs.net 2003, c#,wse1
trying to define a customised version of iCertificatePolicy to allow all
certificates be accepted whilst developing/testing...
I have added this code in the main form of a webservice application which
consumes an x509-signed webservice...
No matter where I put the definition in the form1.cs, I get this compile
error...
> I have added the following class to my code for consuming a webservice. I
> want to be able to accept all certificates for testing etc..
[quoted text clipped - 14 lines]
>
> 'TrustAllCertificatePolicy' does not implement interface member
'System.Net.ICertificatePolicy.CheckValidationResult(System.Net.ServicePoint
> , System.Security.Cryptography.X509Certificates.X509Certificate,
> System.Net.WebRequest, int)'
[quoted text clipped - 4 lines]
>
> Stewart Bourke
Stewart Bourke - 23 Jun 2004 00:02 GMT
any takers?
> Perhaps a bit more info would be in order:
>
[quoted text clipped - 27 lines]
> >
> > 'TrustAllCertificatePolicy' does not implement interface member
'System.Net.ICertificatePolicy.CheckValidationResult(System.Net.ServicePoint
> > , System.Security.Cryptography.X509Certificates.X509Certificate,
> > System.Net.WebRequest, int)'
[quoted text clipped - 4 lines]
> >
> > Stewart Bourke