Repository navigation
Respect context when connecting and close each connection - #59
Open
misiektoja wants to merge 2 commits into
Open
misiektoja wants to merge 2 commits into
misiektoja wants to merge 2 commits into
Conversation
Collaborator
|
Thank you so much for making your internal fixes available for us @misiektoja! I will review your PRs in the days to come this week when I can, and have asked anyone on my team available to review as well. |
toddgaunt-gs
approved these changes
Oct 23, 2026
Collaborator
|
Sorry it's taken longer than I initially hoped to get to these. Reviewing now. |
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes consistently propagate context and handle connection ownership across all affected operations, with no blocking issues identified.
No open issues 🎉
What changed in this PR
This PR makes EST client operations respect context cancellation during connection setup and close their TLS connections when they return, extending timeout coverage to stalled TLS handshakes.
Changes:
- Use
tls.Dialer.DialContextwith the operation context. - Defer connection cleanup in every affected operation while preserving enrollment’s TLS-unique handling.
- Add tests for stalled-handshake deadlines and connection cleanup.
| File | Description |
|---|---|
| est_test.go | Adds deadline and connection-cleanup regression tests. |
| client.go | Propagates context into TLS dialing and closes connections after operations. |
Review effort: Balanced
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.
Hi,
We use an internal fork of this library (disclosure: I work at Nokia). Over the past few months, we've found and fixed several issues. I'm submitting those fixes as separate PRs to bring them upstream and reduce the differences between our fork and this repository.
This PR: connection setup uses tls.Dial before the HTTP request context takes effect. A stalled TLS handshake can therefore block past the deadline. Connections also remain open after operations return.
Use tls.Dialer.DialContext and close each connection when its operation returns, including errors before sending the request. This makes estclient -timeout cover connection setup.
Tests cover stalled handshakes and connection cleanup.