fix: call InitGlobalRegistry so custom TLS fingerprint profiles are loaded#611
Open
liafonx wants to merge 2 commits intoWei-Shaw:mainfrom
Open
fix: call InitGlobalRegistry so custom TLS fingerprint profiles are loaded#611liafonx wants to merge 2 commits intoWei-Shaw:mainfrom
liafonx wants to merge 2 commits intoWei-Shaw:mainfrom
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InitGlobalRegistry()is defined intlsfingerprint/registry.gobut never called anywhere in the codebaseGlobalRegistry()andInitGlobalRegistry()share the samesync.Once— whichever runs first wins permanentlyGlobalRegistry()was called (inDoWithTLS), the registry always contained only the built-in default profileconfig.yamlundergateway.tls_fingerprint.profileswere silently ignoredFix: Call
InitGlobalRegistry(&cfg.Gateway.TLSFingerprint)in theNewHTTPUpstream()constructor, before anyGlobalRegistry()call.sync.Oncemakes this safe to call multiple times.Test plan
config.yamlundergateway.tls_fingerprint.profilesserver.mode: "debug"and restarttls_registry_loaded_profilewith the custom profile name (not just the built-in default)