mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-28 23:19:53 +08:00
fix TrustRootCertificate
This commit is contained in:
@@ -76,9 +76,9 @@ public interface ICertificateManager
|
||||
string? GetCerFilePathGeneratedWhenNoFileExists();
|
||||
|
||||
/// <summary>
|
||||
/// 信任根证书
|
||||
/// 由平台实现的信任根证书引导,有 Root 权限将尝试执行信任,否则则 UI 引导,跳转网页或弹窗
|
||||
/// </summary>
|
||||
void TrustRootCertificate();
|
||||
void PlatformTrustRootCertificateGuide();
|
||||
|
||||
/// <summary>
|
||||
/// 安装根证书,如果没有证书将生成一个新的
|
||||
|
||||
@@ -86,13 +86,29 @@ abstract partial class CertificateManagerImpl
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ICertificateManager.TrustRootCertificate"/>
|
||||
public void TrustRootCertificate()
|
||||
void TrustRootCertificate()
|
||||
{
|
||||
try
|
||||
{
|
||||
SharedTrustRootCertificate();
|
||||
}
|
||||
#if DEBUG
|
||||
catch (Exception e)
|
||||
{
|
||||
e.LogAndShowT(TAG, msg: "TrustRootCertificate Error");
|
||||
}
|
||||
#else
|
||||
catch { }
|
||||
#endif
|
||||
|
||||
PlatformTrustRootCertificateGuide();
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ICertificateManager.PlatformTrustRootCertificateGuide"/>
|
||||
public void PlatformTrustRootCertificateGuide()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (OperatingSystem2.IsMacOS())
|
||||
{
|
||||
TrustRootCertificateMacOS();
|
||||
@@ -105,7 +121,7 @@ abstract partial class CertificateManagerImpl
|
||||
#if DEBUG
|
||||
catch (Exception e)
|
||||
{
|
||||
e.LogAndShowT(TAG, msg: "TrustRootCertificate Error");
|
||||
e.LogAndShowT(TAG, msg: "PlatformTrustRootCertificateGuide Error");
|
||||
}
|
||||
#else
|
||||
catch { }
|
||||
|
||||
@@ -127,7 +127,8 @@ namespace System.Application.UI.ViewModels
|
||||
|
||||
public void TrustCer_OnClick()
|
||||
{
|
||||
reverseProxyService.CertificateManager.TrustRootCertificate();
|
||||
reverseProxyService.CertificateManager.GetCerFilePathGeneratedWhenNoFileExists();
|
||||
reverseProxyService.CertificateManager.PlatformTrustRootCertificateGuide();
|
||||
}
|
||||
|
||||
public override void Activation()
|
||||
|
||||
Reference in New Issue
Block a user