Refresh cached TLS intercept certs before expiry#763
Open
venbrinoDev wants to merge 4 commits into
Open
Conversation
…xpiry in long-lived sandboxes
toksdotdev
reviewed
May 20, 2026
toksdotdev
approved these changes
May 20, 2026
Member
toksdotdev
left a comment
There was a problem hiding this comment.
thanks for the fix. once the minor issue i raised is fixed, should be good to merge.
Author
|
okay @toksdotdev i do change that and make an update |
toksdotdev
approved these changes
May 20, 2026
Member
|
can you take a look at the failing build. ty! |
Author
Sure currently looking at them to see why its failing |
Author
was a formatting issue fixed and pushed |
Member
|
@venbrinoDev still some formatting issues. |
Author
ohh checking it out |
Author
|
Resolved and pushed @toksdotdev also ran it locally incase of any further fmt or lint issue |
Author
|
Hi @toksdotdev, any estimate on when the fix will be pushed? I’d like to update my package version once it’s out. |
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
We run Microsandbox for long-lived user runtimes in production, and this surfaced there as older sandboxes began failing TLS interception for intercepted hosts.
Fix TLS interception for long-lived sandboxes by refreshing cached per-domain leaf certificates when they are expired or near expiry.
Problem
Microsandbox caches generated intercept certs in
TlsState.cert_cache, but cached entries were reused without checking whether the leaf cert had already expired.In practice this caused older sandboxes to start failing TLS for intercepted hosts with errors like:
certificate has expiredSSL certificate problem: certificate has expiredFix
not_afteronDomainCertTlsState::get_or_generate_cert()Files changed
crates/network/lib/tls/certgen.rscrates/network/lib/tls/state.rsTesting
Passed:
Happy to adjust this if there’s a preferred place to handle cert rotation or expiry checks.