From 3c1ceba49e8cfb1479e6582bbc4e56737f6fa2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Mon, 30 Aug 2021 11:06:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=B7=B2=E8=BF=87=E6=97=B6?= =?UTF-8?q?=E7=9A=84tls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.Http/HttpClientHandler.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FastGithub.Http/HttpClientHandler.cs b/FastGithub.Http/HttpClientHandler.cs index acaaf40..db608cc 100644 --- a/FastGithub.Http/HttpClientHandler.cs +++ b/FastGithub.Http/HttpClientHandler.cs @@ -8,6 +8,7 @@ using System.Net; using System.Net.Http; using System.Net.Security; using System.Net.Sockets; +using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; @@ -172,6 +173,7 @@ namespace FastGithub.Http var sslStream = new SslStream(stream, leaveInnerStreamOpen: false); await sslStream.AuthenticateAsClientAsync(new SslClientAuthenticationOptions { + EnabledSslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13, TargetHost = requestContext.TlsSniPattern.Value, RemoteCertificateValidationCallback = ValidateServerCertificate }, cancellationToken);