【发布时间】:2011-05-04 16:59:40
【问题描述】:
我正在尝试通过 https 访问公共托管的 SOAP Web 服务(不是 WCF),但我遇到了以前从未见过的错误。首先,这是事实:
- 此服务需要客户端证书。我的证书由与服务器证书相同的 CA 签名。
- 我知道该 URL 可用,因为我可以在 Internet Explorer 中点击它。 IE 弹出“选择证书”窗口,如果我选择它(并忽略 server-host-name-does-not-match-certificate 错误),它会继续并给我一个 HTTP 500 错误。
- 如果我在 Chrome 中打开该网站,在选择证书并忽略错误后,我会收到一条关于 WSA Action = null 的正常错误消息。
- 如果我在 FireFox 中打开站点,在忽略错误后,我会得到一个关于服务器如何无法验证我的证书的页面。它从来没有让我选择一个,所以这很有意义。
现在,例外:
Error occurred while executing test 12302: System.ServiceModel.Security.SecurityNegotiationException: Could not establish secure channel for SSL/TLS with authority 'ihexds.nist.gov:9085'. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
我已经跟踪了与 WireShark 的交互,但由于我不是 TLS 协议方面的专家,因此我可能会丢失关于正在发生什么的线索。然而,这是我所看到的:
- C -> S 客户端你好
- 包含随机数、日期/时间、支持的密码套件等内容
- S -> C 服务器问候,证书,证书请求,服务器问候完成
- 包含服务器证书和客户端证书请求
- C -> S 证书、客户端密钥交换、更改密码规范、加密握手消息
- 这里是有趣的部分 -- 这个数据包的第一部分是证书握手,我假设客户端证书应该是,但没有证书存在(证书长度:0)。
- S -> C 警报(级别:致命,描述:错误证书)
- 嗯,是的,没有发送证书。
我的绑定设置如下:
<binding name="https_binding">
<textMessageEncoding />
<httpsTransport useDefaultWebProxy="false" />
</binding>
我的行为设置如下:
<behavior name="clientcred">
<clientCredentials>
<clientCertificate findValue="69b6fbbc615a20dc272a79caa201fe3f505664c3" storeLocation="CurrentUser" storeName="My" x509FindType="FindByThumbprint" />
<serviceCertificate>
<authentication certificateValidationMode="None" revocationMode="NoCheck" />
</serviceCertificate>
</clientCredentials>
<messageInspector />
</behavior>
我的端点设置为同时使用绑定和行为。为什么 WCF 在创建 https 连接时拒绝发送证书?
【问题讨论】:
标签: wcf https certificate ssl