fix: initialize scheme before checking security and clear fingerprint for hysteria2 (hy2) schemes

This commit is contained in:
Andrey Petelin
2026-05-29 15:58:02 +05:00
parent c3281773d5
commit 4b03c28c41

View File

@@ -178,8 +178,9 @@ _add_outbound_security() {
local security scheme
security=$(url_get_query_param "$url" "security")
scheme="$(url_get_scheme "$url")"
if [ -z "$security" ]; then
scheme="$(url_get_scheme "$url")"
if [ "$scheme" = "hysteria2" ] || [ "$scheme" = "hy2" ]; then
security="tls"
fi
@@ -195,6 +196,10 @@ _add_outbound_security() {
public_key=$(url_get_query_param "$url" "pbk")
short_id=$(url_get_query_param "$url" "sid")
if [ "$scheme" = "hysteria2" ] || [ "$scheme" = "hy2" ]; then
fingerprint=""
fi
config=$(
sing_box_cm_set_tls_for_outbound \
"$config" \