From f9600d54124492e3067d7aba5b77d13688a11f95 Mon Sep 17 00:00:00 2001 From: xboard <147830212+cedar2025@users.noreply.github.com> Date: Sun, 25 May 2025 00:20:13 +0800 Subject: [PATCH] fix(clash-meta): support custom SNI configuration for anytls protocol --- app/Protocols/ClashMeta.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Protocols/ClashMeta.php b/app/Protocols/ClashMeta.php index b08ba66..32f7d89 100644 --- a/app/Protocols/ClashMeta.php +++ b/app/Protocols/ClashMeta.php @@ -472,8 +472,13 @@ class ClashMeta extends AbstractProtocol 'password' => $password, 'udp' => true, ]; - $array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'tls.allow_insecure', false); + if ($serverName = data_get($protocol_settings, 'tls.server_name')) { + $array['sni'] = $serverName; + } + if ($allowInsecure = data_get($protocol_settings, 'tls.allow_insecure')) { + $array['skip-cert-verify'] = (bool) $allowInsecure; + } return $array; }