Pur*_*ama 5 c# ssl tls1.2 asp.net-core
我们正在使用 ASP.net 核心 1.1.2,我们正在调用启用了 TLS1.2 的 HTTPS 服务。当我们从 Httpclient 调用时,我们收到以下安全错误。
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext()
Run Code Online (Sandbox Code Playgroud)
有没有办法使用 ASP 核心 1.x 使用 httpclient 启用 TLS1.2
来自邮递员的相同 https 调用工作正常
注意:我们尝试了多种可能性,如下所示,但都没有奏效。
handler.ClientCertificateOptions = ClientCertificateOption.Automatic;
handler.SslProtocols = SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls;
handler.PreAuthenticate = true;
handler.ServerCertificateCustomValidationCallback += (message, cert, chain, errors) => { return true; };
Run Code Online (Sandbox Code Playgroud)我们尝试向注册表项添加选项,这也失败了
新服务器添加了新密码,并且客户端必须支持以下 TLS 1.2 密码套件之一:
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
766 次 |
最近记录: |