mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-31 04:12:13 +03:00
fix(sub): drop duplicated fingerprint in external-proxy tlsSettings (#6096)
applyExternalProxyTLSToStream wrote the external proxy fingerprint both to tlsSettings.fingerprint and to tlsSettings.settings.fingerprint, so the generated JSON subscription for an XHTTP Host group carried the same fingerprint twice. Every other field in this function writes a single location, and tlsData already emits fingerprint at the top level, so keep only tlsSettings.fingerprint.
This commit is contained in:
@@ -1625,12 +1625,6 @@ func applyExternalProxyTLSToStream(ep map[string]any, stream map[string]any, sec
|
||||
}
|
||||
if fp, ok := ep["fingerprint"].(string); ok && fp != "" {
|
||||
tlsSettings["fingerprint"] = fp
|
||||
settings, _ := tlsSettings["settings"].(map[string]any)
|
||||
if settings == nil {
|
||||
settings = map[string]any{}
|
||||
tlsSettings["settings"] = settings
|
||||
}
|
||||
settings["fingerprint"] = fp
|
||||
}
|
||||
if alpn, ok := externalProxyALPNList(ep["alpn"]); ok {
|
||||
tlsSettings["alpn"] = alpn
|
||||
|
||||
@@ -775,6 +775,26 @@ func TestApplyExternalProxyTLSToStream_DoesNotLeakAcrossProxies(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyExternalProxyTLSToStream_FingerprintNotDuplicated(t *testing.T) {
|
||||
stream := map[string]any{
|
||||
"security": "tls",
|
||||
"tlsSettings": map[string]any{},
|
||||
}
|
||||
ep := map[string]any{"dest": "proxy.example.com", "fingerprint": "chrome"}
|
||||
|
||||
applyExternalProxyTLSToStream(ep, stream, "tls")
|
||||
|
||||
ts, _ := stream["tlsSettings"].(map[string]any)
|
||||
if ts["fingerprint"] != "chrome" {
|
||||
t.Fatalf("tlsSettings.fingerprint = %v, want %q", ts["fingerprint"], "chrome")
|
||||
}
|
||||
if settings, ok := ts["settings"].(map[string]any); ok {
|
||||
if got, dup := settings["fingerprint"]; dup {
|
||||
t.Fatalf("fingerprint must not be duplicated into tlsSettings.settings, got %v", got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyExternalProxyTLSParams_SetsPinnedPeerCert(t *testing.T) {
|
||||
params := map[string]string{"security": "tls"}
|
||||
ep := map[string]any{
|
||||
|
||||
Reference in New Issue
Block a user