C# and dotnet 4.7.1 not adding custom certificate for TLS 1.2 calls

前端 未结 3 850
野性不改
野性不改 2021-01-07 19:09

I have the following C# code, constructing an https call with a custom certificate. When using Tls 1.1, the call works fine. When using Tls 1.2 the call breaks. I using curl

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-07 20:05

    You are right on the root cause of this problem: By default, schannel-based clients offer SHA1, SHA256, SHA384 and SHA512 (on Win10/Server 2016). So TLS 1.2 servers are not supposed to send their MD5 certs to these clients.

    The client (HttpClient) does not list MD5 in the signature_algorithms extension, so the TLS 1.2 handshake fails. The fix is to use a secure server cert.

提交回复
热议问题