Mar*_*ark 13 ssl https wcf certificate
我试图通过https访问公开托管的SOAP Web服务(而不是WCF),我收到的错误是我以前从未见过的.首先,这是事实:
现在,例外:
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)
Run Code Online (Sandbox Code Playgroud)
我跟踪了与WireShark的交互,但由于我不是TLS协议的专家,我可能会错过关于发生了什么的线索.然而,在这里,我看到的是:
我的绑定设置如下:
<binding name="https_binding">
<textMessageEncoding />
<httpsTransport useDefaultWebProxy="false" />
</binding>
Run Code Online (Sandbox Code Playgroud)
我的行为设置如下:
<behavior name="clientcred">
<clientCredentials>
<clientCertificate findValue="69b6fbbc615a20dc272a79caa201fe3f505664c3" storeLocation="CurrentUser" storeName="My" x509FindType="FindByThumbprint" />
<serviceCertificate>
<authentication certificateValidationMode="None" revocationMode="NoCheck" />
</serviceCertificate>
</clientCredentials>
<messageInspector />
</behavior>
Run Code Online (Sandbox Code Playgroud)
我的端点设置为使用绑定和行为.为什么WCF在创建https连接时拒绝发送证书?
我解决了这个问题,但我不明白为什么这个配置改变了它.我更改了这一行:
<httpsTransport useDefaultWebProxy="false" />
Run Code Online (Sandbox Code Playgroud)
对此:
<httpsTransport useDefaultWebProxy="false" requireClientCertificate="true" />
Run Code Online (Sandbox Code Playgroud)
并且神奇地开始工作了.我知道requireClientCertificate"旋钮"是服务器端的,所以我在争吵时没有尝试过.显然我错了.
| 归档时间: |
|
| 查看次数: |
12857 次 |
| 最近记录: |