when call webservice with bad certificate (VB.NET)
1.Add imports
Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates
2.before calling webservice:
ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf customXertificateValidation)
3.Custom certificate runner:
Private Shared Function customXertificateValidation(ByVal sender As Object, ByVal cert As X509Certificate, ByVal chain As X509Chain, ByVal Errora As SslPolicyErrors) As Boolean
Return True
End Function
more...
1 comment:
for different version of .net different code required here is link on msdn
http://msdn.microsoft.com/en-us/library/bb738067.aspx
Post a Comment