【问题标题】:WCF: Not able to connect to service after enabling TLS 1.2 and disabling SSLWCF:启用 TLS 1.2 并禁用 SSL 后无法连接到服务
【发布时间】:2019-01-04 16:12:18
【问题描述】:

我们正在升级我们的产品以使用 TLS 1.2 版本。为此,我们将所有项目从 .net 4.6.2 升级到 .net 4.7.2 版本并构建它。

我在打开频道时看到一个特定于 WCF 服务的问题

(proxy as ICommunicationObject).Open();

我的代码中已经有了这个:

// https://docs.microsoft.com/en-us/dotnet/framework/whats-new/#wcf47
    
AppContext.SetSwitch("Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols",
        false);
    
    AppContext.SetSwitch("Switch.System.Net.DontEnableSchUseStrongCrypto",
        false);

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

例外:

由于身份验证失败,无法满足对安全令牌的请求。

调用者未经服务验证。

我使用证书(客户端和服务器)进行身份验证

Security.Message.ClientCredentialType = MessageCredentialType.Certificate;

【问题讨论】:

    标签: wcf tls1.2


    【解决方案1】:

    修复了以下问题:

    客户端:

    b.Security.Message.EstablishSecurityContext = false;
    b.Security.Message.NegotiateServiceCredential = false;
    

    服务器端:

    <message clientCredentialType="Certificate" establishSecurityContext="false" negotiateServiceCredential="false"/>
    

    中所述

    https://blogs.msdn.microsoft.com/dsnotes/2017/04/13/wcf-message-security-limitation-with-tls-1-2-protocol/

    【讨论】:

      猜你喜欢
      • 2020-10-28
      • 1970-01-01
      • 1970-01-01
      • 2020-04-05
      • 1970-01-01
      • 2021-11-25
      • 1970-01-01
      • 1970-01-01
      • 2015-05-24
      相关资源
      最近更新 更多