From 4c457d183f41c7d5fb6d122268325ea76c1ea9c4 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Wed, 1 Jul 2020 18:49:51 +0800 Subject: [PATCH] update trojan --- app/Utils/Clash.php | 6 +++++- app/Utils/QuantumultX.php | 3 +-- app/Utils/Surge.php | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Utils/Clash.php b/app/Utils/Clash.php index a5a1b022..3c699d08 100644 --- a/app/Utils/Clash.php +++ b/app/Utils/Clash.php @@ -42,7 +42,11 @@ class Clash $array['port'] = $server->port; $array['password'] = $password; $array['sni'] = $server->server_name; - $array['skip-cert-verify'] = (string)($server->allow_insecure ? true : false); + if ($server->allow_insecure) { + $array['skip-cert-verify'] = true; + } else { + $array['skip-cert-verify'] = false; + } return $array; } } diff --git a/app/Utils/QuantumultX.php b/app/Utils/QuantumultX.php index ac8b1e0d..de0b7fb3 100644 --- a/app/Utils/QuantumultX.php +++ b/app/Utils/QuantumultX.php @@ -33,13 +33,12 @@ class QuantumultX public static function buildTrojan($password, $server) { - $tlsVerification = (string)($server->allow_insecure ? true : false); $config = [ "trojan={$server->host}:{$server->port}", "password={$password}", "over-tls=true", $server->server_name ? "tls-host={$server->server_name}" : "", - "tls-verification={$tlsVerification}", + $server->allow_insecure ? 'tls-verification=true' : 'tls-verification=false', "fast-open=false", "udp-relay=false", "tag={$server->name}" diff --git a/app/Utils/Surge.php b/app/Utils/Surge.php index 593e4672..5f8e6570 100644 --- a/app/Utils/Surge.php +++ b/app/Utils/Surge.php @@ -29,13 +29,12 @@ class Surge public static function buildTrojan($password, $server) { - $skipCertVerify = (string)($server->allow_insecure ? true : false); $config = [ "{$server->name}=trojan", "{$server->host}", "{$server->port}", "password={$password}", - "skip-cert-verify={$skipCertVerify}", + $server->allow_insecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false', $server->server_name ? "sni={$server->server_name}" : "", "tfo=true" ];