From 84f7ecbfdaa23ba626dcdeb0e6203dcd0f92fab4 Mon Sep 17 00:00:00 2001 From: hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:42:31 +0200 Subject: [PATCH] add: allow_insecure flag --- ray2sing/common.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ray2sing/common.go b/ray2sing/common.go index 3a4a880..66dc1cf 100644 --- a/ray2sing/common.go +++ b/ray2sing/common.go @@ -40,16 +40,19 @@ func getTLSOptions(decoded map[string]string) T.OutboundTLSOptionsContainer { if fp == "" { fp = "chrome" } - + insecure, err := getOneOf(decoded, "insecure", "allowinsecure") + if err != nil { + insecure = "false" + } tlsOptions := &option.OutboundTLSOptions{ Enabled: true, ServerName: serverName, - Insecure: decoded["insecure"] == "true", + Insecure: insecure == "true" || insecure == "1", DisableSNI: serverName == "", ECH: ECHOpts, TLSTricks: getTricksOptions(decoded), } - if fp != "" &&!tlsOptions.DisableSNI{ + if fp != "" && !tlsOptions.DisableSNI { tlsOptions.UTLS = &option.OutboundUTLSOptions{ Enabled: true, Fingerprint: fp,