WCF 无法与权限建立 SSL/TLS 安全通道的信任关系
场景:
我有一个在 Azure 中托管的名为 SERVICEA 的 WCF Web 服务。它使用 HTTPS 自签名证书。 该 SERVICEA 检查传入的请求并确定是否调用:
- 服务B 或
- 服务中心
SERVICEB 和 SERVICEC 都使用自签名证书。对于 https。
问题:
当我部署 SERVICEA 并尝试调用以调用 SERVICEB 时,我收到以下错误消息:
*
无法建立 SSL/TLS 安全通道的信任关系 具有权限“SERVICEB...”
*。
请注意,错误消息中显示 SERVICEB..。
请问我该如何解决这个问题?
Scenario:
I've a WCF web service called SERVICEA hosted in Azure. It's uses self signed certificate for HTTPS.
This SERVICEA inspect the incoming request and determines whether to call:
- SERVICEB OR
- SERVICEC
Both SERVICEB AND SERVICEC also uses self signed cert. for https.
PROBLEM:
When I deploy the SERVICEA and try to call so that it invokes SERVICEB I get the error message below:
*
Could not establish trust relationship for the SSL/TLS secure channel
with authority "SERVICEB..."
*.
Note it says SERVICEB.. on error message.
Anyidea how I can resolve this issue, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要验证服务器证书是否是自签名的,如下所示:
You need to validate the server certificate if its self signed as shown below:
您想要捕获 ServerCertificateValidationCallback 并使其忽略您选择的证书。
这是一篇不错的文章,解释了如何操作: http://blog.jameshiggs.com/2008/05/01/c-how-to-accept-an-invalid-ssl-certificate-programmatically/
You want to trap the ServerCertificateValidationCallback and make it ignore certificates of your choosing.
Here is a decent article that explains how: http://blog.jameshiggs.com/2008/05/01/c-how-to-accept-an-invalid-ssl-certificate-programmatically/
Rajesh 说得有道理,但他的回答完全禁用了认证检查。
相反,我建议将如下所示的事件处理程序添加到您的应用程序中:
Rajesh is onto something, but his answer disables certification checks altogether.
Instead I would suggest an event handler like the following should be added to your application: