Skip to content

fix: Clone *tls.Config returned by TLSConfigManager.TLSConfig#27150

Merged
gwossum merged 2 commits intomaster-1.xfrom
gw/TLSConfigManager_TLSConfig_Clone
Jan 28, 2026
Merged

fix: Clone *tls.Config returned by TLSConfigManager.TLSConfig#27150
gwossum merged 2 commits intomaster-1.xfrom
gw/TLSConfigManager_TLSConfig_Clone

Conversation

@gwossum
Copy link
Copy Markdown
Member

@gwossum gwossum commented Jan 23, 2026

TLSConfigManager.TLSConfig() will now always returned a cloned *tls.Config. This eliminates the need to manually cloning the returned *tls.Config before using it to Dial or Listen. It will also eliminate any bugs in current code which used the returned config without cloning it.

TLSConfigManager.TLSConfig() will now always returned a cloned
*tls.Config. This eliminates the need to manually cloning the returned
*tls.Config before using it to Dial or Listen. It will also eliminate
any bugs in current code which used the returned config without cloning
it.
Copy link
Copy Markdown

@devanbenz devanbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gwossum gwossum merged commit f8351ea into master-1.x Jan 28, 2026
9 checks passed
@gwossum gwossum deleted the gw/TLSConfigManager_TLSConfig_Clone branch January 28, 2026 17:41
gwossum added a commit that referenced this pull request Feb 12, 2026
* fix: Clone *tls.Config returned by TLSConfigManager.TLSConfig

TLSConfigManager.TLSConfig() will now always returned a cloned
*tls.Config. This eliminates the need to manually cloning the returned
*tls.Config before using it to Dial or Listen. It will also eliminate
any bugs in current code which used the returned config without cloning
it.

* chore: fix issue in test code

(cherry picked from commit f8351ea)
gwossum added a commit that referenced this pull request Feb 12, 2026
Add `tlsconfig.TLSConfigManager` for managing TLS configurations, handling certificate reloads, logging certificate expiration warnings, etc.

This is backport of the following master-1.x PRs to the 1.12 branch:
- #27100: feat: add TLSConfigManager for managing TLS configuration (clean cherry-pick)
- #27103: feat: add TLSConfigManager.DialWithDialer method (clean cherry-pick)
- #27106: feat: add NewClientTLSConfigManager and NewDisabledTLSConfigManager  (clean cherry-pick)
- #27120: feat: add TLSConfigManager.UseTLS (clean cherry-pick)
- #27150: fix: Clone *tls.Config returned by TLSConfigManager.TLSConfig (clean cherry-pick)
- #27162: feat: multiple TLS configuration improvements  (almost clean cherry-pick)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants