From 384757b9f51190bcc0ec92f8cfe8dc6a9b3f4d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Fri, 30 Jul 2021 17:37:20 +0800 Subject: [PATCH] =?UTF-8?q?SSL=E6=9C=80=E4=BD=8E=E8=A6=81=E6=B1=82v1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KestrelServerOptionsExtensions.cs | 10 ++++++---- FastGithub.ReverseProxy/RequestLoggingMilldeware.cs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs index 8cdc7b5..da4272a 100644 --- a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs +++ b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs @@ -8,6 +8,7 @@ using System; using System.Linq; using System.Net; using System.Net.NetworkInformation; +using System.Security.Authentication; namespace FastGithub { @@ -61,10 +62,11 @@ namespace FastGithub certService.CreateCaCertIfNotExists(); certService.InstallAndTrustCaCert(); - kestrel.Listen(IPAddress.Any, HTTPS_PORT, listen => - listen.UseHttps(https => - https.ServerCertificateSelector = (ctx, domain) => - certService.GetOrCreateServerCert(domain))); + kestrel.Listen(IPAddress.Any, HTTPS_PORT, listen => listen.UseHttps(https => + { + https.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13; + https.ServerCertificateSelector = (ctx, domain) => certService.GetOrCreateServerCert(domain); + })); } /// diff --git a/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs b/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs index e838031..afe4064 100644 --- a/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs +++ b/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs @@ -60,7 +60,7 @@ namespace FastGithub.ReverseProxy } else { - this.logger.LogError($"{message}{Environment.NewLine}{exception}"); + this.logger.LogError($"{message}{Environment.NewLine}{exception.Message}"); } } }