Skip to content

Auto-port 5.0: Enable OpenSslCachingKeyMaterialProvider to evict stale entries after cert rotation#16802

Merged
chrisvest merged 1 commit into
5.0from
auto-port-pr-16523-to-5.0
May 12, 2026
Merged

Auto-port 5.0: Enable OpenSslCachingKeyMaterialProvider to evict stale entries after cert rotation#16802
chrisvest merged 1 commit into
5.0from
auto-port-pr-16523-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16523 to 5.0
Cherry-picked commit: 40b824b


Motivation:

The current OpenSslCachingKeyMaterialProvider does not evict stale entries after a cert rotation.
This is related to a performance concern when using grpc-java (grpc/grpc-java#12670)

Modification:

Added evictStaleEntries(), which removes cached entries whose alias is no longer recognized by the X509KeyManager. It is called on a cache miss when new material is successfully loaded, so stale entries from rotated credentials are pruned before inserting the new one.

Result:

Better support for cert rotation.
Related discussion:
grpc/grpc-java#12686
grpc/grpc-java#12670

… cert rotation (#16523)

### Motivation:

The current `OpenSslCachingKeyMaterialProvider` does not evict stale
entries after a cert rotation.
This is related to a performance concern when using grpc-java
(grpc/grpc-java#12670)

###  Modification:
Added `evictStaleEntries()`, which removes cached entries whose alias is
no longer recognized by the `X509KeyManager`. It is called on a cache
miss when new material is successfully loaded, so stale entries from
rotated credentials are pruned before inserting the new one.

 ### Result:
Better support for cert rotation.
  Related discussion:
  grpc/grpc-java#12686
  grpc/grpc-java#12670

---------

Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
(cherry picked from commit 40b824b)
@chrisvest chrisvest added this to the 5.0.0.Final milestone May 12, 2026
@chrisvest chrisvest merged commit d93f404 into 5.0 May 12, 2026
20 of 23 checks passed
@chrisvest chrisvest deleted the auto-port-pr-16523-to-5.0 branch May 12, 2026 22:20
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.

3 participants