【问题标题】:Security exception when wcf service server and client certificate is different than SSl certificatewcf 服务服务器和客户端证书与 Ssl 证书不同时的安全异常
【发布时间】:2015-08-17 07:21:23
【问题描述】:

我是 WCF 新手,很难理解证书身份验证和加密。

我有一个使用 clientcredentialtype="Certificate" 的 WCF 服务。

我已经使用 makecert 工具生成了 CA 证书、服务器和客户端证书。

服务托管在 IIS 中。

当我为我的网站使用 SSl 时,我遇到了一个安全异常:

Could not establish trust relationship for the SSL/TLS secure channel with authority 'fqdn;. 
System.Net.webException: The underlying connection was closed: 
Could not establish trust relationship for the SSL/TLS secure channel. ---> 
System.Security.Authentication.AuthenticationException: The remore 
certificate is invalid according to the validation procedure. 

SSl 证书和 WCF 证书来自不同的证书颁发机构。

为什么会抛出安全异常?

客户端和服务器之间的通信是如何进行的以及正在使用哪些证书?我真的很困惑。任何帮助将不胜感激。

【问题讨论】:

    标签: c# wcf security ssl https


    【解决方案1】:

    MakeCert 工具会创建默认不受信任的自签名证书,因为没有来自证书颁发机构的签名来证明证书上信息的合法性。

    当您的客户端连接时,除非禁用证书验证或您推出自己的检查方案,否则使用典型验证过程将失败。也就是说,根 CA 不通过证书信任链信任您的证书。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-09
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 2015-10-20
      • 2021-08-05
      • 2011-06-11
      • 2014-02-23
      相关资源
      最近更新 更多