-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ErrPeerIDMismatch error type to replace ad-hoc errors #2451
Conversation
Would this be resolved by quic-go/quic-go#3730 (comment) (i.e. by returning / wrapping the error returned by crypto/tls)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very clean.
Before merging I'd like to:
- Figure out what to do with QUIC.
- Add a transport integration test for this.
a6d4520
to
69498e7
Compare
Thanks @aschmahmann! This is a nice addition |
c8707b9
to
fcd3351
Compare
Seems like the quic-go branch from the linked PR doesn't work with Go 1.21 and that when that's updated things should pass here. |
Yay, that's the last-minute breaking change Go 1.21 introduced again: golang/go@a915b999c9. I rebased the quic-go PR and updated the dependency here, and now tests are passing. I'll take this as confirmation that quic-go/quic-go#4015 is the right way to go and will go ahead and merge that PR. Will ship in the v0.38 release later this month. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, minus one little thing
// Try connecting with the bogus peer ID | ||
if err := testHost.Connect(ctx, *ai); err != nil { | ||
// Extract the actual peer ID from the error | ||
newPeerId, err := extractPeerIDFromError(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assert the error returned has the correct values for expected and actual. I can see this being missed by accident silently.
14ac002
to
f0ca926
Compare
#2506 was merged. I'll be taking over this PR to make sure we can include it in the v0.31 release. Hope you don't mind. |
Definitely don't mind. Thanks for pushing this over the finish line (and doing the associated quic-go PR)🙏. |
partially resolves #2449.
This PR mostly works. However, it doesn't work with QUIC because QUIC encapsulates the error string instead of exposing it via unwrapping in https://github.com/quic-go/quic-go/blob/f3a0ce1599732cb56b958c2f0903074b62a7e9bf/internal/handshake/crypto_setup.go#L643.
Could add additional tests (or move over the ones from vole) if we're happy with this PR.
@marten-seemann is making a change to quic-go to allow inspection of the inner error inside the transport error reasonable?