You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(iroh)!: Update dependencies & fix 0-RTT with newer rustls by pulling the expected NodeId out of the ServerName in verifiers (#3290)
## Description
This is code that will both update deps like #3288 but also makes 0-RTT
tests pass again.
They were failing due to a [change in
`rustls`](https://github.com/rustls/rustls/releases/tag/v%2F0.23.24):
> Behavior change: Clients no longer offer resumption between different
`ClientConfig`s that share a resumption store but do not share server
certificate verification and client authentication credentials. If you
share a resumption store between multiple `ClientConfig`s, please ensure
their server certificate verification and client authentication
credentials are also shared. Please read the new documentation on the
`ClientConfig::resumption` item for details.
>
> Additionally, if you share a resumption store or ticketer between
multiple `ServerConfig`s, please see the new documentation on
`ServerConfig` about this.
Essentially what they're doing is [checking that the certificate
verifiers are `Arc::prt_eq` and depending on that allow or disallow
0-RTT](https://github.com/rustls/rustls/pull/2361/files#diff-9d58cb90e1df25604b88544aca7ea999ccd23bc5657384e196e77f407c0f4acfR256).
When running the tests with rustls logging enabled, I confirmed that
this is indeed what's happening:
> [TRACE rustls::msgs::persist] resumption not allowed between different
ServerCertVerifiers
---
The fix isn't straight-forward.
The reason we're creating new `ServerVerifier`s every time is that we're
passing in the expected remote node ID every time.
There used to be no other way of grabbing the other node's ID in the
verifier, until, coincidentally #3146 landed, which changed the server
name that's set when connecting from always being `localhost` to
`<base32 NodeId>.iroh.invalid`.
I'm now pulling in that value from the `ServerName` that's passed to the
`ServerCertificateVerifier` in `verify_server_cert`.
As far as I understand that value *should* be a client-set value not a
value we get over the network.
The downside of doing this is that we'll not be compatible with iroh
versions that don't use the `<base32 NodeId>.iroh.invalid` server names.
---
There's an unrelated change in here that's changing `make_client_config`
and `make_server_config` infallible, as was done in #3161, which will
definitely also have merge conflicts with this PR.
## Breaking Changes
- `Router::spawn` is now a plain function instead of an `async fn`
- `Router::spawn` is now infallible, instead of returning
`anyhow::Result<()>`
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] All breaking changes documented.
- [x] List all breaking changes in the above "Breaking Changes" section.
---------
Co-authored-by: dignifiedquire <me@dignifiedquire.com>
0 commit comments