Created by: Manas Varma on 23-03-2011 08:10:24 AM Hi All, I am trying to add a new user using CUPI. Here is my code below. Can you please suggest what changes I need to perform for it to work. I am using c#
Subject: RE: Error: The remote certificate is invalid according to the validation pr Replied by: Mayank Sharma on 23-03-2011 08:18:25 AM Create a new Class like this:
public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy { public TrustAllCertificatePolicy() { }
public bool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest req, int problem) { return true; } }
Then instantiate it just before you do your CUPI work. System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
Basically, the error says that the cert is invalid, you are just ignoring that error like this.
Subject: RE: Error: The remote certificate is invalid according to the validation pr Replied by: Mayank Sharma on 23-03-2011 08:19:28 AM You need to add "using System.Security.Cryptography.X509Certificates;" namespace too.
Subject: RE: Error: The remote certificate is invalid according to the validation pr Replied by: Manas Varma on 23-03-2011 10:29:09 AM
You need to add "using System.Security.Cryptography.X509Certificates;" namespace too.
Thanks Mayank. It workded , but I am getting BAD Request (400) error after that. Can you please suggest , if there is something wrong with the query that I am passing for adding users.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: