Web Services .net framework 2 over SSL
I have just ported an ASP.NET 1.1 application to framework version 2 and i have a problem.I used to use the following code in framework 1.1.
//
// workaround to make the webservice call work over ssl
//
System.Net.ServicePointManager.CertificatePolicy =newWebServicePolicyHelper();MyWebService ws =newMyWebService();
result = ws.MyMethod(params...);When I compile the program in framework Version 2, it tells me that 'CertificatePolicy' is obsolete and tells me to use 'ServerCertificateValidationCallback' instead.
I can't find any help on how to use this class. Has anybody used this?
Any help will be appreciated.
Dave Bates
I've just figured out the reason for the error message. It's because the target web server does not have an ssl certificate.
Anyway thanks again for your help.
Dave
Hi,
I want to consume a Webservice over SSL on the Compact Framework 2.0.
In my WinForms App I'm using ServerCertificateValidationCallback, but that seems to have been removed from the CF.net 2.0?
I would have fallen back to using the magic AcceptAllCertificatePolicy, but
System.Net.ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
actually tells me that ICertificatPolicy is defined in a not referenced assembly. It tells me to reference System, Version 2.0.0.0, culture=neutral. Well looking in my references lists, of course System is referenced and yes the versions are identical, just the culture field is empty, which I am supposing means neutral?
Can you help me on this one?