There are so many web base devices, and some webserver device do not have a valid certification,

While access HTTPS using Webclient, will get a trouble with Certification if there is no valid one.

When I access Envoy Local Servier using HTTPS, I have expericed it.

 

First, create a Validation Server Function as below

 

Public Function ValidateServerCertificate(ByVal sender As Object, ByVal certificate As Object, ByVal chain As Object, ByVal sslPolicyErrors As Net.Security.SslPolicyErrors) As Boolean


        Return True


End Function

 

And, Connect the validate server as

 

Net.ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)

 

When call HTTPS using Webclient, Webclient server will call the user defined server code, and can over-ride an error 

 

You can put the code into MAIN() -0r-  Sub New() once