c# - 如何在.Net C# 中绕过 SSL 证书发出 HTTPS SOAP 请求?

标签 c# .net https soap-client web-reference

我在尝试访问 c# .Net 项目中的 HTTPS Web 引用服务时遇到问题。

当我尝试向网络服务发送请求时收到此消息。

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

然后我找到了解决方案检查答案。

最佳答案

我将此代码放入我的 Web 服务类构造函数中。

ServicePointManager.ServerCertificateValidationCallback +=
                (mender, certificate, chain, sslPolicyErrors) => true;

它解决了问题。

关于c# - 如何在.Net C# 中绕过 SSL 证书发出 HTTPS SOAP 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28232750/

相关文章:

c# - UWP更改AppBarButton的样式打破了动态溢出的自动样式

c# - 从另一个类访问私有(private)方法

c# - 如何使用 C# 进行 XSLT 2.0 转换

c# - 如何解决这个 :Struct In Collection not changed

java - 为什么 SSL 握手有时会杀死我的 CPU?

c# - 为什么我的 Web API 的响应格式不正确?

c# - 如何将空组添加到 Linq 查询结果集中?

apache - 从 https 重写为 http

带有用户名和密码的 c# VssBasicCredential

c# - 自定义通用集合 - 重构它的最佳方法是什么?