我正在尝试连接到 Azure 服务管理 API(这是一个带有证书的 WCF https 调用)。获取“无法使用权限‘management.core.windows.net’为 SSL/TLS 建立安全通道。内部异常:请求被中止:无法创建 SSL/TLS 安全通道。 ”错误
我尝试了互联网上建议的以下设置:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
证书作为通过字节数组序列化的对象附加。它不在证书存储中,因此从证书存储读取它没有权限问题。
这是我们 web.config 的 system.serviceModel 中的相关部分
<bindings>
<webHttpBinding>
<binding name="WindowsAzureServiceManagement_WebHttpBinding" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxStringContentLength="10000000" maxBytesPerRead="10000000" />
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="https://management.core.windows.net"
binding="webHttpBinding"
bindingConfiguration="WindowsAzureServiceManagement_WebHttpBinding"
contract="AzureWatch.WindowsAzure.ServiceManagement.IServiceManagement"
name="WindowsAzureEndPoint" />
<endpoint address="https://api.authorize.net/soap/v1/Service.asmx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="Service.ServiceSoap" name="ServiceSoap" />
</client>
有什么建议么?