diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
index 3fcfc0b2..204c3402 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
+++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
@@ -2797,6 +2797,15 @@ namespace ServiceLib.Resx {
}
}
+ ///
+ /// 查找类似 Fetch Certificate Chain 的本地化字符串。
+ ///
+ public static string TbFetchCertChain {
+ get {
+ return ResourceManager.GetString("TbFetchCertChain", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Fingerprint 的本地化字符串。
///
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
index f89c1343..5b13bc86 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
@@ -1612,4 +1612,7 @@ Do not use the "Fetch Certificate" button when "Allow Insecure" is enabled.
Fetch Certificate
+
+ Fetch Certificate Chain
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fr.resx b/v2rayN/ServiceLib/Resx/ResUI.fr.resx
index 9e46bad5..395058a5 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fr.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fr.resx
@@ -1609,4 +1609,7 @@ Do not use the "Fetch Certificate" button when "Allow Insecure" is enabled.
Fetch Certificate
+
+ Fetch Certificate Chain
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx
index 1b47e7e6..9c530b4d 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx
@@ -1612,4 +1612,7 @@ Do not use the "Fetch Certificate" button when "Allow Insecure" is enabled.
Fetch Certificate
+
+ Fetch Certificate Chain
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx
index 62a80bf3..4875265a 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.resx
@@ -1612,4 +1612,7 @@ Do not use the "Fetch Certificate" button when "Allow Insecure" is enabled.
Fetch Certificate
+
+ Fetch Certificate Chain
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx
index 568ecdca..a0d95e29 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx
@@ -1612,4 +1612,7 @@ Do not use the "Fetch Certificate" button when "Allow Insecure" is enabled.
Fetch Certificate
+
+ Fetch Certificate Chain
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
index 4c449915..b00731aa 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
@@ -1609,4 +1609,7 @@
获取证书
+
+ 获取证书链
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
index cf94f135..0b81d0aa 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
@@ -1609,4 +1609,7 @@ Do not use the "Fetch Certificate" button when "Allow Insecure" is enabled.
Fetch Certificate
+
+ Fetch Certificate Chain
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs b/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs
index d42c4db3..ae9d7249 100644
--- a/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs
+++ b/v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs
@@ -12,6 +12,7 @@ public class AddServerViewModel : MyReactiveObject
public string Cert { get; set; }
public ReactiveCommand FetchCertCmd { get; }
+ public ReactiveCommand FetchCertChainCmd { get; }
public ReactiveCommand SaveCmd { get; }
public AddServerViewModel(ProfileItem profileItem, Func>? updateView)
@@ -23,6 +24,10 @@ public class AddServerViewModel : MyReactiveObject
{
await FetchCert();
});
+ FetchCertChainCmd = ReactiveCommand.CreateFromTask(async () =>
+ {
+ await FetchCertChain();
+ });
SaveCmd = ReactiveCommand.CreateFromTask(async () =>
{
await SaveServerAsync();
@@ -117,4 +122,24 @@ public class AddServerViewModel : MyReactiveObject
}
Cert = await Utils.GetCertPem(domain, serverName);
}
+
+ private async Task FetchCertChain()
+ {
+ if (SelectedSource.StreamSecurity != Global.StreamSecurity)
+ {
+ return;
+ }
+ var domain = SelectedSource.Address;
+ var serverName = SelectedSource.Sni.IsNullOrEmpty() ? SelectedSource.Address : SelectedSource.Sni;
+ if (!Utils.IsDomain(serverName))
+ {
+ return;
+ }
+ if (SelectedSource.Port > 0)
+ {
+ domain += $":{SelectedSource.Port}";
+ }
+ var certs = await Utils.GetCertChainPem(domain, serverName);
+ Cert = string.Join("\n", certs);
+ }
}
diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml
index f9848f63..721db784 100644
--- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml
+++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml
@@ -607,10 +607,10 @@