feat(iroh-relay)!: Allow setting a custom ServerCertVerifier and rename CaRootsConfig to CaTlsConfig#4300
feat(iroh-relay)!: Allow setting a custom ServerCertVerifier and rename CaRootsConfig to CaTlsConfig#4300Frando wants to merge 12 commits into
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4300/docs/iroh/ Last updated: 2026-06-09T13:33:26Z |
flub
left a comment
There was a problem hiding this comment.
For the issue you also need to be able to use a custom server cert verifier for the https probes in net-report as well as for the relay connection.
I was thinking of adding a endpoint::Builder::server_cert_verifier(impl rustls::client::danger::ServerCertVerifier + 'static) builder method for this feature.
It is really unfortunate that you're breaking the API in iroh-relay for this. Can that not be avoided? We just need to get used to it, it'll be fine.
Both the HTTPS probes and the relay connection already use the The config is created and passed through already.
I think this would then conflict with
It could, but then the custom option can only be able to supply a |
|
I pushed a commit that changes the PR to expose setting a |
flub
left a comment
There was a problem hiding this comment.
Implementation looks fine.
I'm once more going to suggest that this is so easy to do in a backwards compatible way. We just leave the old enum variant around as deprecated and leave the old name around as a deprecated type alias. I think it will give people much more confidence that the 1.0 will be serious about not breaking things than still doing breaking changes. Especially given it is so easy to not break.
It would be rather straightforward, yes: Here's a commit that adds deprecated aliases: Frando/tls-custom...Frando/tls-custom-bwcompat There's one breaking change that I'd like to leave in and that is the removal of So, do we want the deprecated aliases? Happy to add them. Who makes the call, @dignifiedquire ? |
flub
left a comment
There was a problem hiding this comment.
I'm reverting my opinion on this. The feature is lovely. But we can not do any breaking changes anymore.
|
I pushed another commit to remove the last breaking change and keeps (btw: semver check did not catch the breaking change before. it seems it can't see through type aliases. so we can not fully rely on this and still need to check things by hand.) |
Description
This adds a new mode to fully customize the
rustls::ServerCertVerifierused for non-iroh TLS requests throughout iroh, and renamesCaRootsConifgtoCaTlsConfig(with a deprecated alias to keep backwards compat). A new modeCaTlsConfig::custom_server_cert_verifierallows to supply a callback that gets passed aCryptoProviderand returns aArc<dyn ServerCertVerifier>.It is indended for advanced usecases like those described in #2901.
Fixes #2901
cc @link2xt
Breaking Changes
None.
The following items have been deprecated:
iroh_relay::tls::CaRootsConfig, useiroh_relay::tls::CaTlsConfiginstead (also re-exported asiroh::tls::CaTlsConfig).iroh_relay::tls::CaRootsConfig::custom, useCaTlsConfig::custom_rootsinsteadiroh::endpoint::Builder::ca_roots_config, useiroh::endpoint::Builder::ca_tls_configinsteadNotes & open questions
Change checklist