From 763236d050da68b42713a7dd862320264a8e443b Mon Sep 17 00:00:00 2001 From: patterniha <71074308+patterniha@users.noreply.github.com> Date: Fri, 10 Jul 2026 06:11:33 +0330 Subject: [PATCH] feat: apply CipherSuites to sing-box TLS outbounds sing-box supports cipher_suites on outbound TLS (a list of the same Go TLS names Xray takes as a colon-separated string), so the setting no longer silently does nothing when a profile runs on the sing-box core. Add cipher_suites to Tls4Sbox and map it in GenOutboundTls for the TLS branch only (REALITY uses uTLS where cipher suites do not apply), splitting the stored string on ":" or ",". Co-Authored-By: Claude Fable 5 --- v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs | 1 + .../CoreConfig/Singbox/SingboxOutboundService.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs b/v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs index a835b15f05e..ccae7472487 100644 --- a/v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs +++ b/v2rayN/ServiceLib/Models/CoreConfigs/SingboxConfig.cs @@ -184,6 +184,7 @@ public class Tls4Sbox public string? server_name { get; set; } public bool? insecure { get; set; } public List? alpn { get; set; } + public List? cipher_suites { get; set; } public Utls4Sbox? utls { get; set; } public Reality4Sbox? reality { get; set; } public bool? fragment { get; set; } diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs index 81027a1f2e5..9be9be49350 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs @@ -433,6 +433,15 @@ private void FillOutboundTls(Outbound4Sbox outbound) } if (_node.StreamSecurity == Global.StreamSecurity) { + if (_node.CipherSuites.IsNotEmpty()) + { + // Xray stores cipher suites as a colon-separated string; sing-box wants a list of the same Go TLS names + tls.cipher_suites = _node.CipherSuites + .Split([':', ','], StringSplitOptions.RemoveEmptyEntries) + .Select(c => c.Trim()) + .Where(c => c.IsNotEmpty()) + .ToList(); + } var certs = CertPemManager.ParsePemChain(_node.Cert); if (certs.Count > 0) {