C# (ASP.Net) error
Error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
and:
The remote certificate is invalid according to the validation procedure.
Below code can be used to bypass ssl related errors while calling webservices from your .net code
Error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
and:
The remote certificate is invalid according to the validation procedure.
Below code can be used to bypass ssl related errors while calling webservices from your .net code
string sUrl = "http://mysite.com/myservice"; System.Net.WebClient client = new System.Net.WebClient(); System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; string sHttpResonse = client.DownloadString(sUrl);
No comments:
Post a Comment