【问题标题】:Force by config to use tls 1.0 in a wcf client c#通过配置强制在 wcf 客户端 c# 中使用 tls 1.0
【发布时间】:2015-12-18 01:05:02
【问题描述】:

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

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>

【问题讨论】:

    标签: c# wcf ssl asp.net-4.0 tls1.2


    【解决方案1】:
    <customBinding >
      <binding name="CusSoap">                  
           <sslStreamSecurity requireClientCertificate="true"   sslProtocols="Ssl3|Tls|Tls11|Tls12" />                    
            </binding>
    

    但它在 Visual Studio 2015(.Net Framework 4.5.2) 中可用

    【讨论】:

      猜你喜欢
      • 2020-09-03
      • 1970-01-01
      • 1970-01-01
      • 2012-01-05
      • 2012-02-29
      • 2019-12-07
      • 2011-05-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多