I\'m searching for a way to validate (or bypass validation for) self-signed SSL certificates using VB .Net. I found code to do this in C# and tried converting it into VB co
One-liner:
System.Net.ServicePointManager.ServerCertificateValidationCallback = _
Function(se As Object, _
cert As System.Security.Cryptography.X509Certificates.X509Certificate, _
chain As System.Security.Cryptography.X509Certificates.X509Chain, _
sslerror As System.Net.Security.SslPolicyErrors) True
Credits to Robby Tendean
I'm not sure but this should work:
ServicePointManager.ServerCertificateValidationCallback = _
New RemoteCertificateValidationCallback(AddressOf AcceptAllCertifications)
http://msdn.microsoft.com/de-de/library/system.net.security.remotecertificatevalidationcallback%28VS.90%29.aspx
In VB.Net,
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
solves the less secure apps problem.
In VB.Net, you need to write
ServicePointManager.ServerCertificateValidationCallback = AddressOf AcceptAllCertifications