Trying to set up a self signed certificate, for our intranet\'s web services site. The certificate itself shows it is \"ok\" but when trying to invoke a method from the web
Add this line of code somewhere before you create your service client.
ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);
Do note: this will cause your app to accept all invalid certs and just keep moving. If this is not acceptable, you can attach a function to that and do processing to determine if the cert error is ok or not
iamkrillin did have a working solution, in that his code will ignore the invalid cert, and allow the application to use the web service.
In addition to this, I have corrected the certificate so that i no longer need to ignore the invalid cert.
The host header value (shown in OP) was WebServices.mycompany.vmc , but the "Common Name" or "Friendly Name" for the certificate (shown in OP screenshot 3 for 'Certification Path') was WebServices.
The common name, and the website URL need to match. I recreated the self-signed cert with a common name of "WebServices.mycompany.vmc" and now the certificate error is gone. The web service is available for use, without the coder needing to ignore invalid certs for the application.