Skip to content

feat(s2n-quic-dc): Send detailed transport error information over the wire#3065

Open
ben-r-smith wants to merge 6 commits intoaws:mainfrom
ben-r-smith:feature/transparent-connection-close
Open

feat(s2n-quic-dc): Send detailed transport error information over the wire#3065
ben-r-smith wants to merge 6 commits intoaws:mainfrom
ben-r-smith:feature/transparent-connection-close

Conversation

@ben-r-smith
Copy link
Copy Markdown
Contributor

@ben-r-smith ben-r-smith commented May 5, 2026

Release Summary:

  • feat(s2n-quic): Support connection close formatter on quic endpoints
  • feat(s2n-quic-dc): Send detailed transport error information over the wire

Resolved issues:

N/A

Description of changes:

Currently, s2n-quic does not support overriding the connection close formatter on its endpoints. The default formatter for production does not share specific transport error reasons for security purposes.

This PR introduces support for the connection close formatter on QUIC server/client endpoints. It then utilizes this feature in s2n-quic-dc to send transport error messages as-is to the remote.

Call-outs:

N/A

Testing:

A test was added to s2n-quic-dc.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ben-r-smith ben-r-smith changed the title Support connection close formatter on quic endpoints feat(s2n-quic-dc): Send detailed transport error information over the wire May 5, 2026
@ben-r-smith ben-r-smith marked this pull request as ready for review May 5, 2026 17:52
@ben-r-smith ben-r-smith requested review from a team as code owners May 5, 2026 17:53
ClientProviders
);

#[cfg(any(test, feature = "unstable-provider-connection-close-formatter"))]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stable builder methods have some pretty lengthy comments on them, though it seems we've fallen out of that practice for the unstable methods. I think its probably worth documenting in a comment what this is for

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some info including an example here.

//# Reason Phrase field and SHOULD use the APPLICATION_ERROR code when
//# converting to a CONNECTION_CLOSE of type 0x1c.

transport::Error::APPLICATION_ERROR.into()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you losing anything interesting by doing this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is we need to clear the reason field regardless so we wouldn't be able to pass this over in a similar fashion. That brings into question if this should be customizable at all. Maybe I'm misunderstanding something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it all comes down to the threat model of how you are using it. For Development anything is fine, so the customization is allowed. I was just trying to understand if there is anything this would throw away that could be useful for s2n-quic-dc and still safe given the threat model. But its not a one-way door, so we can change it later anyway

Comment thread dc/s2n-quic-dc/src/connection_close.rs Outdated
use s2n_quic::provider::connection_close_formatter::{ConnectionClose, Context, Formatter};
use s2n_quic_core::{application, transport};

/// A formatter that passes transport errors through for debuggability.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this comment be fleshed out a bit, just explaining what this does more specifically from the Production and Development formatters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And perhaps a small discussion on when/why it is safe to use this formatter

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, updated for both.

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.

2 participants