Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone TLS config before changing it #552

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

ghjm
Copy link
Contributor

@ghjm ghjm commented Feb 17, 2022

GetConfigForClient returns a new tls.Config customized for the client currently connecting. The function is a closure on tlscfg from the outer scope, so when we assign to tlscfg.VerifyPeerCertificate, our change affects future connections that reuse this configuration. The immediate solution is to make a local clone inside GetConfigForClient so our change doesn't propagate to the outer scope.

@shanemcd shanemcd merged commit 3aa8561 into ansible:devel Feb 22, 2022
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.

2 participants