Repository navigation
Conversation
Consumers that configure Redis TLS from files had to read and validate the CA bundle themselves before populating CACert. Add CACertFile so BuildTLSConfig loads it, rejecting missing, empty, and malformed files instead of falling back to system roots. CACert and CACertFile are mutually exclusive. Config.Validate still avoids filesystem access; the file is read when the TLS configuration is built. InsecureSkipVerify and CACertFile gain json/yaml tags so the type can be used in serialized configuration. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
9 of 14 tasks
reyortiz3
enabled auto-merge (squash)
October 16, 2026 21:52
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
redisconn.TLSConfigonly accepts a CA bundle as bytes (CACert), so every consumer that configures Redis TLS from a file has to read, empty-check and validate the bundle itself before callingBuildTLSConfig. toolhive does exactly this inpkg/redisconfig, alongside a second, parallel serializable TLS type for the auth server.This adds
CACertFileso the library owns file loading, with the same strictness consumers already apply by hand.BuildTLSConfigreadsCACertFilewhen set. A missing, empty, or malformed file is an error; it never falls back to system roots or plaintext.CACertandCACertFileare mutually exclusive.Config.Validate()stays free of filesystem access; the file is read when the TLS configuration is built (whichNewClientreaches).InsecureSkipVerifyandCACertFilegainjson/yamltags (insecureSkipVerify,caCertFile) so the type can be used in serialized configuration. Decoding stays compatible; encodingInsecureSkipVerifynow emits the camelCase key.redispackage aliases this type and picks up the field automatically.Type of change
Test plan
go test -raceforredisconn, including a new table-drivenTestBuildTLSConfigCACertFile(valid, missing, empty, malformed, and both fields set)task lint(0 issues) andtask license-checkNotes for reviewers
CACert,ClientCert,ClientKey) are intentionally left untagged. Serializing key material should be a deliberate decision, so the struct is partly tagged for now.redisconnis released as its own module, so consumers need a newredisconnrelease to use this.🤖 Generated with Claude Code