Either through WMSvc or through your own script, whenever you try to establish a connection with a remote server, which doesn’t provide a trusted certificate you need to provide a delegate for this certificate validation check to validate untrusted certificates.
The signature for this delegate is as follows
Namespace: System.Net.Security Assembly: System (in System.dll)
public delegate bool RemoteCertificateValidationCallback(
Thus, to accept ALL server certificates, you will need to set the callback of ServicePointManager to validate a server certificate in the following manner:
ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCallbackFlag;
For the official MSDN documentation on this delegate refer to RemoteCertificateValidationCallback Delegate and ServicePointManager.ServerCertificateValidationCallback Property
SDET, IIS Team