有人可以给出描述或(更优选)对.NET框架如何验证域证书的引用吗?
我正在尝试连接到使用带有证书传输安全性的BasicHttpBinding配置的WCF服务。服务在机器1上,服务器在机器2上。两台机器都连接到域。服务证书由域的证书颁发机构颁发。但是,当客户端(在我的情况下是Visual Studio添加服务引用向导)正在与服务协商时,它会弹出一条警告消息,其中有三个可能的原因导致证书不受信任:
但我问的是原因1,为什么?
另一方面,如果我使用WcfTestClient,则会弹出以下错误:
URI: https://ip:port/svc
Metadata contains a reference that cannot be resolved: 'https://ip:port/svc'.
Could not establish trust relationship for the SSL/TLS secure channel with authority 'ip:port'.
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.HTTP GET Error.
URI: https://ip:port/svc
There was an error downloading 'https://ip:port/svc'.
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.
有人可以告诉我这里发生了什么吗?如何验证服务证书?请不要告诉我写一个PermissivePolicy来覆盖默认程序?
答案 0 :(得分:1)
你在这里打了两张支票:
修复此错误很简单 - 只需使用正确的主机名重新颁发证书,并将所需的部分添加到对等的“根”存储中。