Repository navigation
csi: Cache CA certificate pool in CSI TLS verification - #1344
Merged
Merged
Conversation
hajiler
force-pushed
the
csi-tls-cache
branch
2 times, most recently
from
September 8, 2026 22:08
c090911 to
90c28d8
Compare
hajiler
marked this pull request as ready for review
September 8, 2026 22:16
hajiler
requested review from
Taahir Ahmed (ahmedtd) and
Michelle Au (msau42)
September 8, 2026 22:16
ILLUM1N0X
reviewed
Sep 10, 2026
ILLUM1N0X
reviewed
Sep 10, 2026
ILLUM1N0X
suggested changes
Sep 10, 2026
This change introduces a thread-safe caPoolCache that caches the parsed cert pool in memory and checks file metadata (stat matching) and certificate expiration (earliest NotAfter) to avoid redundant disk reads while preserving automatic CA rotation pickup.
hajiler
force-pushed
the
csi-tls-cache
branch
from
September 11, 2026 18:02
90c28d8 to
f281399
Compare
ILLUM1N0X
approved these changes
Sep 14, 2026
Michelle Au (msau42)
approved these changes
Sep 15, 2026
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.
Fixes #1182
Description
In
resolveTLSConfig, TLS verification was configured to dynamically read and parse the CA trust bundle on every handshake to support zero-downtime CA rotation. However, reading and parsing PEM certificates from disk on every connection causes unnecessary disk I/O and CPU overhead.This PR introduces an in-memory caching mechanism for the CA certificate pool:
Adds a thread-safe
caPoolCachethat caches the parsed*x509.CertPoolin memory.Uses stat-matching (
os.SameFile, modtime, size) to determine when a reload is needed.[X ] Tests pass
Appropriate changes to documentation are included in the PR