2015-09-21 52 views
6

我们有一个Web应用程序,它具有用WCF实现的客户端。该客户端使用SSL_LVL3与外部服务进行握手。事实证明,该服务刚刚禁用了SSL_LVL3,因此我们需要将其更改为TLS 1.0。 有一种方法来强制TLS安全在C#:强制配置在wcf客户端中使用tls 1.0 c#

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; 

但它改变所使用的应用程序,而不是所有的服务接受TLS的所有服务的安全性。

我们想要的是更改web.config以强制WCF服务使用TLS。有没有办法做到这一点?

这是该服务的绑定:

<binding name="XXXX" closeTimeout="00:01:00" openTimeout="00:01:00" 
    receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" 
    bypassProxyOnLocal="false" NameComparisonMode= "StrongWildcard" 
    maxBufferPoolSize="524288" maxBufferSize="655360" 
    maxReceivedMessageSize="655360" textEncoding="utf-8" 
    transferMode="Buffered" useDefaultWebProxy="true" 
    messageEncoding="Text"> 
    <security mode="Transport" /> 
</binding> 

回答

1
<customBinding > 
    <binding name="CusSoap">     
     <sslStreamSecurity requireClientCertificate="true" sslProtocols="Ssl3|Tls|Tls11|Tls12" />      
     </binding> 

但它在Visual Studio 2015年是可用的(.Net框架4.5.2)