mirror of
https://github.com/2dust/v2rayN.git
synced 2025-12-11 09:22:58 +00:00
Add TLS ALPN check for WS (#8469)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
This commit is contained in:
parent
7cee98887b
commit
6e27dca6cd
9 changed files with 44 additions and 1 deletions
|
|
@ -193,6 +193,19 @@ public class ActionPrecheckManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ws with tls, tls alpn should contain "http/1.1" in xray core
|
||||||
|
// rfc6455
|
||||||
|
// https://github.com/XTLS/Xray-core/blob/81f8f398c7b2b845853b1e85087c6122acc6db0b/transport/internet/tls/tls.go#L95-L116
|
||||||
|
if (item.Network == nameof(ETransport.ws)
|
||||||
|
&& item.StreamSecurity == Global.StreamSecurity)
|
||||||
|
{
|
||||||
|
var alpnList = Utils.String2List(item.Alpn) ?? [];
|
||||||
|
if (alpnList.Count > 0 && !alpnList.Contains("http/1.1"))
|
||||||
|
{
|
||||||
|
errors.Add(ResUI.AlpnMustContainHttp11ForWsTls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
11
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
11
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
|
|
@ -19,7 +19,7 @@ namespace ServiceLib.Resx {
|
||||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
public class ResUI {
|
public class ResUI {
|
||||||
|
|
@ -78,6 +78,15 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 ALPN must contain 'http/1.1' when using WebSocket with TLS. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string AlpnMustContainHttp11ForWsTls {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("AlpnMustContainHttp11ForWsTls", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Export share link to clipboard successfully 的本地化字符串。
|
/// 查找类似 Export share link to clipboard successfully 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>Configuration Item 2, Select and add from self-built</value>
|
<value>Configuration Item 2, Select and add from self-built</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>ALPN must contain 'http/1.1' when using WebSocket with TLS.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -1638,4 +1638,7 @@ Si un certificat auto-signé est utilisé ou si le système contient une CA non
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>Configuration Item 2, Select and add from self-built</value>
|
<value>Configuration Item 2, Select and add from self-built</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>ALPN must contain 'http/1.1' when using WebSocket with TLS.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>Configuration Item 2, Select and add from self-built</value>
|
<value>Configuration Item 2, Select and add from self-built</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>ALPN must contain 'http/1.1' when using WebSocket with TLS.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>Configuration Item 2, Select and add from self-built</value>
|
<value>Configuration Item 2, Select and add from self-built</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>ALPN must contain 'http/1.1' when using WebSocket with TLS.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>Configuration Item 2, Select and add from self-built</value>
|
<value>Configuration Item 2, Select and add from self-built</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>ALPN must contain 'http/1.1' when using WebSocket with TLS.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -1638,4 +1638,7 @@
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>子配置项二,从自建中选择添加</value>
|
<value>子配置项二,从自建中选择添加</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>使用 WebSocket+TLS 时,ALPN 必须包含 'http/1.1'。</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -1638,4 +1638,7 @@
|
||||||
<data name="menuServerList2" xml:space="preserve">
|
<data name="menuServerList2" xml:space="preserve">
|
||||||
<value>子配置項二,從自建中選擇新增</value>
|
<value>子配置項二,從自建中選擇新增</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AlpnMustContainHttp11ForWsTls" xml:space="preserve">
|
||||||
|
<value>ALPN must contain 'http/1.1' when using WebSocket with TLS.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Loading…
Reference in a new issue