From 511adffc5bb419a938e3b1eb0087a49f62d76db6 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Wed, 11 Feb 2026 18:18:05 +0100 Subject: Remove allowInsecure Remove the deprecated `allowInsecure` --- sub/subJsonService.go | 3 --- sub/subService.go | 26 ++++---------------------- 2 files changed, 4 insertions(+), 25 deletions(-) (limited to 'sub') diff --git a/sub/subJsonService.go b/sub/subJsonService.go index 8222491a..72c5c6f1 100644 --- a/sub/subJsonService.go +++ b/sub/subJsonService.go @@ -253,9 +253,6 @@ func (s *SubJsonService) tlsData(tData map[string]any) map[string]any { tlsData["serverName"] = tData["serverName"] tlsData["alpn"] = tData["alpn"] - if allowInsecure, ok := tlsClientSettings["allowInsecure"].(bool); ok { - tlsData["allowInsecure"] = allowInsecure - } if fingerprint, ok := tlsClientSettings["fingerprint"].(string); ok { tlsData["fingerprint"] = fingerprint } diff --git a/sub/subService.go b/sub/subService.go index e046ebb4..818f193b 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -270,9 +270,6 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string { if fpValue, ok := searchKey(tlsSettings, "fingerprint"); ok { obj["fp"], _ = fpValue.(string) } - if insecure, ok := searchKey(tlsSettings, "allowInsecure"); ok { - obj["allowInsecure"], _ = insecure.(bool) - } } } @@ -296,7 +293,7 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string { newSecurity, _ := ep["forceTls"].(string) newObj := map[string]any{} for key, value := range obj { - if !(newSecurity == "none" && (key == "alpn" || key == "sni" || key == "fp" || key == "allowInsecure")) { + if !(newSecurity == "none" && (key == "alpn" || key == "sni" || key == "fp")) { newObj[key] = value } } @@ -431,11 +428,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { if fpValue, ok := searchKey(tlsSettings, "fingerprint"); ok { params["fp"], _ = fpValue.(string) } - if insecure, ok := searchKey(tlsSettings, "allowInsecure"); ok { - if insecure.(bool) { - params["allowInsecure"] = "1" - } - } } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { @@ -501,7 +493,7 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { q := url.Query() for k, v := range params { - if !(newSecurity == "none" && (k == "alpn" || k == "sni" || k == "fp" || k == "allowInsecure")) { + if !(newSecurity == "none" && (k == "alpn" || k == "sni" || k == "fp")) { q.Add(k, v) } } @@ -632,11 +624,6 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string if fpValue, ok := searchKey(tlsSettings, "fingerprint"); ok { params["fp"], _ = fpValue.(string) } - if insecure, ok := searchKey(tlsSettings, "allowInsecure"); ok { - if insecure.(bool) { - params["allowInsecure"] = "1" - } - } } } @@ -698,7 +685,7 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string q := url.Query() for k, v := range params { - if !(newSecurity == "none" && (k == "alpn" || k == "sni" || k == "fp" || k == "allowInsecure")) { + if !(newSecurity == "none" && (k == "alpn" || k == "sni" || k == "fp")) { q.Add(k, v) } } @@ -837,11 +824,6 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st if fpValue, ok := searchKey(tlsSettings, "fingerprint"); ok { params["fp"], _ = fpValue.(string) } - if insecure, ok := searchKey(tlsSettings, "allowInsecure"); ok { - if insecure.(bool) { - params["allowInsecure"] = "1" - } - } } } @@ -870,7 +852,7 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st q := url.Query() for k, v := range params { - if !(newSecurity == "none" && (k == "alpn" || k == "sni" || k == "fp" || k == "allowInsecure")) { + if !(newSecurity == "none" && (k == "alpn" || k == "sni" || k == "fp")) { q.Add(k, v) } } -- cgit v1.2.3