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

前端 未结 3 848
野性不改
野性不改 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 19:45

    Shouldn't you specified the handler's SslProtocols property?

    Try adding this line after hander definition:

    handler.SslProtocols = SslProtocols.Tls12;
    

提交回复
热议问题