我正在尝试连接到Azure Service Management API(这是一个附带证书的WCF https调用)。 获取“无法为具有权限的SSL / TLS建立安全通道'management.core.windows.net'。内部异常:请求已中止:无法创建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>
有什么建议吗?