修改提示语
This commit is contained in:
parent
e69ed66797
commit
da7c4ee564
@ -22,6 +22,7 @@ namespace FastGithub.Dns
|
||||
private const int INTERNET_OPTION_REFRESH = 37;
|
||||
private const int INTERNET_OPTION_PROXY_SETTINGS_CHANGED = 95;
|
||||
|
||||
private const char PROXYOVERRIDE_SEPARATOR = ';';
|
||||
private const string PROXYOVERRIDE_KEY = "ProxyOverride";
|
||||
private const string INTERNET_SETTINGS = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings";
|
||||
|
||||
@ -108,7 +109,8 @@ namespace FastGithub.Dns
|
||||
/// </summary>
|
||||
private void CheckProxyConflict()
|
||||
{
|
||||
if (HttpClient.DefaultProxy == null)
|
||||
var systemProxy = HttpClient.DefaultProxy;
|
||||
if (systemProxy == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -116,10 +118,10 @@ namespace FastGithub.Dns
|
||||
foreach (var domain in this.options.Value.DomainConfigs.Keys)
|
||||
{
|
||||
var destination = new Uri($"https://{domain.Replace('*', 'a')}");
|
||||
var proxyServer = HttpClient.DefaultProxy.GetProxy(destination);
|
||||
var proxyServer = systemProxy.GetProxy(destination);
|
||||
if (proxyServer != null)
|
||||
{
|
||||
this.logger.LogError($"由于系统配置了代理{proxyServer},{nameof(FastGithub)}无法加速{domain}");
|
||||
this.logger.LogError($"由于系统设置了代理{proxyServer},{nameof(FastGithub)}无法加速{domain}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -132,7 +134,15 @@ namespace FastGithub.Dns
|
||||
private static string[] GetProxyOvride(RegistryKey registryKey)
|
||||
{
|
||||
var value = registryKey.GetValue(PROXYOVERRIDE_KEY, null)?.ToString();
|
||||
return value == null ? Array.Empty<string>() : value.Split(';', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (value == null)
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
|
||||
return value
|
||||
.Split(PROXYOVERRIDE_SEPARATOR, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(item => item.Trim())
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -142,7 +152,7 @@ namespace FastGithub.Dns
|
||||
/// <param name="items"></param>
|
||||
private static void SetProxyOvride(RegistryKey registryKey, IEnumerable<string> items)
|
||||
{
|
||||
var value = string.Join(';', items);
|
||||
var value = string.Join(PROXYOVERRIDE_SEPARATOR, items);
|
||||
registryKey.SetValue(PROXYOVERRIDE_KEY, value, RegistryValueKind.String);
|
||||
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY_SETTINGS_CHANGED, IntPtr.Zero, 0);
|
||||
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using FastGithub.Configuration;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -75,15 +74,15 @@ namespace FastGithub.HttpServer
|
||||
}
|
||||
else if (OperatingSystem.IsLinux())
|
||||
{
|
||||
this.logger.LogWarning($"请根据具体linux发行版手工安装CA证书{this.CaCerFilePath}");
|
||||
this.logger.LogWarning($"请根据具体linux发行版手动安装CA证书{this.CaCerFilePath}");
|
||||
}
|
||||
else if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
this.logger.LogWarning($"请手工安装CA证书然后设置信任CA证书{this.CaCerFilePath}");
|
||||
this.logger.LogWarning($"请手动安装CA证书然后设置信任CA证书{this.CaCerFilePath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.logger.LogWarning($"请根据你的系统平台手工安装和信任CA证书{this.CaCerFilePath}");
|
||||
this.logger.LogWarning($"请根据你的系统平台手动安装和信任CA证书{this.CaCerFilePath}");
|
||||
}
|
||||
|
||||
GitConfigSslverify(false);
|
||||
@ -141,7 +140,7 @@ namespace FastGithub.HttpServer
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.logger.LogWarning($"请手工安装CA证书{this.CaCerFilePath}到“将所有的证书都放入下载存储”\\“受信任的根证书颁发机构”");
|
||||
this.logger.LogWarning($"请手动安装CA证书{this.CaCerFilePath}到“将所有的证书都放入下列存储”\\“受信任的根证书颁发机构”");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user