mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-04 04:22:08 +03:00
Add VerifyPeerCertByName support
https://github.com/2dust/v2rayN/issues/9427
This commit is contained in:
@@ -255,6 +255,7 @@ public static class ConfigHandler
|
|||||||
item.Cert = profileItem.Cert;
|
item.Cert = profileItem.Cert;
|
||||||
item.CertSha = profileItem.CertSha;
|
item.CertSha = profileItem.CertSha;
|
||||||
item.EchConfigList = profileItem.EchConfigList;
|
item.EchConfigList = profileItem.EchConfigList;
|
||||||
|
item.VerifyPeerCertByName = profileItem.VerifyPeerCertByName;
|
||||||
item.Finalmask = profileItem.Finalmask;
|
item.Finalmask = profileItem.Finalmask;
|
||||||
item.ProtoExtra = profileItem.ProtoExtra;
|
item.ProtoExtra = profileItem.ProtoExtra;
|
||||||
item.TransportExtra = profileItem.TransportExtra;
|
item.TransportExtra = profileItem.TransportExtra;
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ public class BaseFmt
|
|||||||
{
|
{
|
||||||
dicQuery.Add("ech", Utils.UrlEncode(item.EchConfigList));
|
dicQuery.Add("ech", Utils.UrlEncode(item.EchConfigList));
|
||||||
}
|
}
|
||||||
|
if (item.VerifyPeerCertByName.IsNotEmpty())
|
||||||
|
{
|
||||||
|
dicQuery.Add("vcn", Utils.UrlEncode(item.VerifyPeerCertByName));
|
||||||
|
}
|
||||||
if (item.CertSha.IsNotEmpty())
|
if (item.CertSha.IsNotEmpty())
|
||||||
{
|
{
|
||||||
dicQuery.Add("pcs", Utils.UrlEncode(item.CertSha));
|
dicQuery.Add("pcs", Utils.UrlEncode(item.CertSha));
|
||||||
@@ -227,6 +231,7 @@ public class BaseFmt
|
|||||||
item.SpiderX = GetQueryDecoded(query, "spx");
|
item.SpiderX = GetQueryDecoded(query, "spx");
|
||||||
item.Mldsa65Verify = GetQueryDecoded(query, "pqv");
|
item.Mldsa65Verify = GetQueryDecoded(query, "pqv");
|
||||||
item.EchConfigList = GetQueryDecoded(query, "ech");
|
item.EchConfigList = GetQueryDecoded(query, "ech");
|
||||||
|
item.VerifyPeerCertByName = GetQueryDecoded(query, "vcn");
|
||||||
item.CertSha = GetQueryDecoded(query, "pcs");
|
item.CertSha = GetQueryDecoded(query, "pcs");
|
||||||
|
|
||||||
var finalmaskDecoded = GetQueryDecoded(query, "fm");
|
var finalmaskDecoded = GetQueryDecoded(query, "fm");
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ public class TlsSettings4Ray
|
|||||||
public string? spiderX { get; set; }
|
public string? spiderX { get; set; }
|
||||||
public string? mldsa65Verify { get; set; }
|
public string? mldsa65Verify { get; set; }
|
||||||
public List<CertificateSettings4Ray>? certificates { get; set; }
|
public List<CertificateSettings4Ray>? certificates { get; set; }
|
||||||
|
public string? verifyPeerCertByName { get; set; }
|
||||||
public string? pinnedPeerCertSha256 { get; set; }
|
public string? pinnedPeerCertSha256 { get; set; }
|
||||||
public bool? disableSystemRoot { get; set; }
|
public bool? disableSystemRoot { get; set; }
|
||||||
public string? echConfigList { get; set; }
|
public string? echConfigList { get; set; }
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ public class ProfileItem
|
|||||||
public string Cert { get; set; }
|
public string Cert { get; set; }
|
||||||
public string CertSha { get; set; }
|
public string CertSha { get; set; }
|
||||||
public string EchConfigList { get; set; }
|
public string EchConfigList { get; set; }
|
||||||
|
public string VerifyPeerCertByName { get; set; }
|
||||||
public string Finalmask { get; set; }
|
public string Finalmask { get; set; }
|
||||||
|
|
||||||
public string ProtoExtra { get; set; }
|
public string ProtoExtra { get; set; }
|
||||||
|
|||||||
Generated
+10
-1
@@ -1,4 +1,4 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// 此代码由工具生成。
|
// 此代码由工具生成。
|
||||||
// 运行时版本:4.0.30319.42000
|
// 运行时版本:4.0.30319.42000
|
||||||
@@ -3006,6 +3006,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Verify Peer Cert By Name 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbVerifyPeerCertByName {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbVerifyPeerCertByName", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Edit 的本地化字符串。
|
/// 查找类似 Edit 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1581,6 +1581,9 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="TbEchConfigList" xml:space="preserve">
|
<data name="TbEchConfigList" xml:space="preserve">
|
||||||
<value>EchConfigList</value>
|
<value>EchConfigList</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbVerifyPeerCertByName" xml:space="preserve">
|
||||||
|
<value>Verify Peer Cert By Name</value>
|
||||||
|
</data>
|
||||||
<data name="TbFullCertTips" xml:space="preserve">
|
<data name="TbFullCertTips" xml:space="preserve">
|
||||||
<value>Full certificate (chain), PEM format</value>
|
<value>Full certificate (chain), PEM format</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1746,4 +1746,7 @@
|
|||||||
<data name="MsgAllowInsecureDeprecated" xml:space="preserve">
|
<data name="MsgAllowInsecureDeprecated" xml:space="preserve">
|
||||||
<value>警告:Xray 将在 2026.8.1 禁用跳过证书验证 allowInsecure ,请尽快改用证书固定指纹 pinnedPeerCertSha256。到期后无法使用 </value>
|
<value>警告:Xray 将在 2026.8.1 禁用跳过证书验证 allowInsecure ,请尽快改用证书固定指纹 pinnedPeerCertSha256。到期后无法使用 </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbVerifyPeerCertByName" xml:space="preserve">
|
||||||
|
<value>Verify Peer Cert By Name</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1746,4 +1746,7 @@
|
|||||||
<data name="MsgAllowInsecureDeprecated" xml:space="preserve">
|
<data name="MsgAllowInsecureDeprecated" xml:space="preserve">
|
||||||
<value>警告:Xray 將在 2026.8.1 停用跳過憑證驗證 allowInsecure ,請盡快改用憑證固定指紋 pinnedPeerCertSha256。到期後無法使用 allowInsecure。</value>
|
<value>警告:Xray 將在 2026.8.1 停用跳過憑證驗證 allowInsecure ,請盡快改用憑證固定指紋 pinnedPeerCertSha256。到期後無法使用 allowInsecure。</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbVerifyPeerCertByName" xml:space="preserve">
|
||||||
|
<value>Verify Peer Cert By Name</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -384,6 +384,7 @@ public partial class CoreConfigV2rayService
|
|||||||
alpn = _node.GetAlpn(),
|
alpn = _node.GetAlpn(),
|
||||||
fingerprint = _node.Fingerprint.IsNullOrEmpty() ? _config.CoreBasicItem.DefFingerprint : _node.Fingerprint,
|
fingerprint = _node.Fingerprint.IsNullOrEmpty() ? _config.CoreBasicItem.DefFingerprint : _node.Fingerprint,
|
||||||
echConfigList = _node.EchConfigList.NullIfEmpty(),
|
echConfigList = _node.EchConfigList.NullIfEmpty(),
|
||||||
|
verifyPeerCertByName = _node.VerifyPeerCertByName.NullIfEmpty(),
|
||||||
};
|
};
|
||||||
if (sni.IsNotEmpty())
|
if (sni.IsNotEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1060,7 +1060,7 @@
|
|||||||
Grid.Row="8"
|
Grid.Row="8"
|
||||||
ColumnDefinitions="300,Auto"
|
ColumnDefinitions="300,Auto"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
@@ -1129,6 +1129,20 @@
|
|||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="6"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Static resx:ResUI.TbVerifyPeerCertByName}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtVerifyPeerCertByName"
|
||||||
|
Grid.Row="6"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="7"
|
Grid.Row="7"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
this.Bind(ViewModel, vm => vm.AllowInsecureCertFetch, v => v.togAllowInsecureCertFetch.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AllowInsecureCertFetch, v => v.togAllowInsecureCertFetch.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.AllowInsecureCertFetch, v => v.txtAllowInsecureCertFetchTips.IsVisible).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AllowInsecureCertFetch, v => v.txtAllowInsecureCertFetchTips.IsVisible).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.EchConfigList, v => v.txtEchConfigList.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.EchConfigList, v => v.txtEchConfigList.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.VerifyPeerCertByName, v => v.txtVerifyPeerCertByName.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
//reality
|
//reality
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI2.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI2.Text).DisposeWith(disposables);
|
||||||
|
|||||||
@@ -1377,6 +1377,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="300" />
|
<ColumnDefinition Width="300" />
|
||||||
@@ -1461,6 +1462,22 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="6"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbVerifyPeerCertByName}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtVerifyPeerCertByName"
|
||||||
|
Grid.Row="6"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="7"
|
Grid.Row="7"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ public partial class AddServerWindow
|
|||||||
.BindTo(this, v => v.txtAllowInsecureCertFetchTips.Visibility);
|
.BindTo(this, v => v.txtAllowInsecureCertFetchTips.Visibility);
|
||||||
this.Bind(ViewModel, vm => vm.Cert, v => v.txtCert.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Cert, v => v.txtCert.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.EchConfigList, v => v.txtEchConfigList.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.EchConfigList, v => v.txtEchConfigList.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.VerifyPeerCertByName, v => v.txtVerifyPeerCertByName.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
//reality
|
//reality
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI2.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI2.Text).DisposeWith(disposables);
|
||||||
|
|||||||
Reference in New Issue
Block a user