Repository navigation
fix: enforce negotiated TLS peer-close policy - #15
Merged
Merged
Conversation
Branch clean peer close on SSLSocket.version(). TLS 1.3 preserves accepted output, TLS 1.2 starts reciprocal close_notify immediately and records the exact unsent count, and missing or unknown versions fail closed. Service already-buffered TLS plaintext before the first local unwrap so shutdown does not strand accepted ingress. Real loopback tests cover both endpoint roles and TLS versions.
Collaborator
Author
|
Upstream prerequisite: the recurrent Once that exists, upstream can add negotiated TLS 1.2 versus TLS 1.3 peer-close policy, exact stranded-output reporting, and fail-closed handling for unknown negotiated versions. |
This was referenced Aug 28, 2026
Collaborator
Author
|
Implements the primary downstream fix for ioflo#177: negotiated TLS 1.2 versus TLS 1.3 peer-close policy, exact stranded-output reporting, and fail-closed handling for missing or unsupported negotiated versions. |
This was referenced Aug 29, 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.
What
SSLSocket.version().close_notify.close_notifyand report the exact stranded-byte count.unwrap().Why
TLS 1.2 requires reciprocal closure and discarded pending writes. TLS 1.3 ends only the peer's write direction, leaving local transmission available. Applying one policy to both versions either loses valid output or permits forbidden transmission.
Background
SSLSocket.unwrap()drives OpenSSL shutdown recurrently through WANT states. This PR adds the policy for the version actually negotiated on the connection and keeps accepted-output loss observable.Boundary
PR #16 fixes a later
unwrap()retry race and expands shutdown coverage. HTTP framing, owner deadlines, close invocation, package metadata, and publication remain separate concerns.