Skip to content

fix: call InitGlobalRegistry so custom TLS fingerprint profiles are loaded#611

Open
liafonx wants to merge 2 commits intoWei-Shaw:mainfrom
liafonx:fix/init-global-tls-registry
Open

fix: call InitGlobalRegistry so custom TLS fingerprint profiles are loaded#611
liafonx wants to merge 2 commits intoWei-Shaw:mainfrom
liafonx:fix/init-global-tls-registry

Conversation

@liafonx
Copy link

@liafonx liafonx commented Feb 24, 2026

Summary

  • InitGlobalRegistry() is defined in tlsfingerprint/registry.go but never called anywhere in the codebase
  • GlobalRegistry() and InitGlobalRegistry() share the same sync.Once — whichever runs first wins permanently
  • Since only GlobalRegistry() was called (in DoWithTLS), the registry always contained only the built-in default profile
  • Custom profiles configured in config.yaml under gateway.tls_fingerprint.profiles were silently ignored

Fix: Call InitGlobalRegistry(&cfg.Gateway.TLSFingerprint) in the NewHTTPUpstream() constructor, before any GlobalRegistry() call. sync.Once makes this safe to call multiple times.

Test plan

  • Configure a custom TLS fingerprint profile in config.yaml under gateway.tls_fingerprint.profiles
  • Set server.mode: "debug" and restart
  • Verify logs show tls_registry_loaded_profile with the custom profile name (not just the built-in default)
  • Confirm requests use the configured cipher suites (e.g. via packet capture or debug logging)

…oaded

InitGlobalRegistry() is defined in tlsfingerprint/registry.go but never
called anywhere. Because GlobalRegistry() uses the same sync.Once,
whichever runs first wins permanently — and since only GlobalRegistry()
was called (in DoWithTLS), the registry always contained only the
built-in default profile.

Custom profiles configured in config.yaml under
gateway.tls_fingerprint.profiles were silently ignored.

Fix: call InitGlobalRegistry(&cfg.Gateway.TLSFingerprint) in the
NewHTTPUpstream() constructor, before any GlobalRegistry() call.
sync.Once makes this safe to call multiple times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant