如何连接到具有错误安全证书的Web服务

时间:2015-09-04 08:35:54

标签: c# web-services ssl ws-security

我有以下测试服务:

https://197.253.5.218/OnlineIntegration/DBConnect.asmx

在任何浏览器中打开它都会发出此警告

"此网站的安全证书存在问题"

但是,我可以忽略该警告并查看Web服务描述。

从代码中访问相同内容会引发此异常:

Message=System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ServiceModel.Security.SecurityNegotiationException: Could not establish trust relationship for the SSL/TLS secure channel with authority '197.253.5.218'. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

是否可以选择从代码中绕过此类错误的安全证书?

感谢。

0 个答案:

没有答案