WCF 错误:“X.509 证书 CN=localhost 链构建失败 ..." [英] WCF error: "The X.509 certificate CN=localhost chain building failed ..."

查看:22
本文介绍了WCF 错误:“X.509 证书 CN=localhost 链构建失败 ..."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试使我的 WCF 客户端和服务器相互通信时遇到此错误.

<块引用>

X.509 证书 CN=localhost 链构建失败.这使用的证书具有无法验证的信任链.更换证书或更改 certificateValidationMode.一个证书链已处理,但在根证书中终止不受信任的信任.

如果我关闭 SSL 证书,一切都会完美运行.

解决方案

您的证书有问题(我想您使用自签名证书) WCF 尝试验证所有颁发者链并期望,最终链将以 root 受信任的权限结束.要禁用该检查,您可以将这样的行添加到 app.config 分支.但是这个拐杖"不应该在生产中使用serviceBehaviors/behavior/serviceCredentials/clientCertificate

<上一页><认证证书ValidationMode="PeerOrChainTrust" revocationMode="NoCheck"/>

I'm getting this error while attempting to make my WCF client and server talk to each other.

The X.509 certificate CN=localhost chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain processed, but terminated in a root certificate which is not trusted by the trust.

Everything works perfectly if I turn SSL certificates off.

解决方案

There is a problem with your certificate (I suppose you use self-signed cert) WCF tries to verify all the chain of issuers and expects, that finally chain would end on root trusted authority. To disable that check you could add such line to app.config branch. But this "crutch" shouldn't be used in production serviceBehaviors/behavior/serviceCredentials/clientCertificate

<authentication certificateValidationMode="PeerOrChainTrust" revocationMode="NoCheck" />

这篇关于WCF 错误:“X.509 证书 CN=localhost 链构建失败 ..."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆