From 60ce50797837e161b63c809894a4d6673e34894d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Tue, 27 Jul 2021 09:30:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.Dns/DnsHostedService.cs | 4 ++-- .../KestrelServerOptionsExtensions.cs | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/FastGithub.Dns/DnsHostedService.cs b/FastGithub.Dns/DnsHostedService.cs index 37083c7..f421ba3 100644 --- a/FastGithub.Dns/DnsHostedService.cs +++ b/FastGithub.Dns/DnsHostedService.cs @@ -63,12 +63,12 @@ namespace FastGithub.Dns } catch (Exception ex) { - this.logger.LogWarning($"设置为本机主DNS失败:{ex.Message}"); + this.logger.LogWarning($"设置为本机主DNS为{IPAddress.Loopback}失败:{ex.Message}"); } } else { - this.logger.LogWarning("平台不支持自动设置DNS,请手动设置网卡的主DNS为127.0.0.1"); + this.logger.LogWarning($"不支持自动设置DNS,请根据你的系统平台情况修改主DNS为{IPAddress.Loopback}"); } await this.hostsValidator.ValidateAsync(); diff --git a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs index ec1451b..6dbbcea 100644 --- a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs +++ b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs @@ -77,6 +77,11 @@ namespace FastGithub /// private static void InstallCaCert(string caPublicCerPath, ILogger logger) { + if (OperatingSystem.IsWindows() == false) + { + logger.LogWarning($"不支持自动安装根证书{caPublicCerPath}:请根据你的系统平台情况安装和信任根证书"); + } + try { var caCert = new X509Certificate2(caPublicCerPath); @@ -90,14 +95,7 @@ namespace FastGithub } catch (Exception) { - if (OperatingSystem.IsWindows()) - { - logger.LogWarning($"安装根证书{caPublicCerPath}失败:请手动安装到“将所有的证书都放入下载存储”\\“受信任的根证书颁发机构”"); - } - else - { - logger.LogWarning($"安装根证书{caPublicCerPath}失败:请根据你的系统平台要求安装和信任根证书"); - } + logger.LogWarning($"安装根证书{caPublicCerPath}失败:请手动安装到“将所有的证书都放入下载存储”\\“受信任的根证书颁发机构”"); } }