Skip to content
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(iroh)!: implement support for raw public keys in TLS #2937

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Nov 15, 2024

Description

This is step one of #2798. This introduces the configuration of the TLS authentication method, allowing to enable the usage of raw public keys, which will lead to us being able to remove the hack of using self signed certificates.

TODOs

  • add configuration in iroh
  • tests
  • cleanup

Breaking Changes

By default iroh endpoints will now use the new RawPublicKey TLS configuration. This means they will not be able to talk to older iroh nodes. If needed, the old mechanism can still be used by configuring the endpoint like this

let endpoint = Endpoint::builder()
   .tls_x509() // <--- this enables the old style TLS authentication
   // ...
   .bind();

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

github-actions bot commented Nov 15, 2024

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2937/docs/iroh/

Last updated: 2025-02-12T19:09:31Z

@dignifiedquire dignifiedquire added this to the v0.30.0 milestone Nov 15, 2024
Copy link

github-actions bot commented Nov 15, 2024

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: df4e537

@matheus23
Copy link
Member

For a hot minute I was imagining a feature on rustls to disable all non-RPK paths, imagining that we could get rid of ASN.1/DER parsing code.
Then I remembered that we still use HTTPS 🙃

use crate::tls::Authentication;

#[derive(Debug)]
pub(crate) struct AlwaysResolvesCert {
Copy link
Member

Choose a reason for hiding this comment

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

Kind of annoying that rustls has all the implementations for ResolvesClientCert and ResolvesServerCert that we need, but they're not all exposed.

There's

  • AlwaysResolvesClientCert
  • AlwaysResolvesServerCert
  • AlwaysResolvesClientRawPublicKeyCert
  • AlwaysResolvesServerRawPublicKeyCert

I'd rather not have to implement a trait outside the crate where it's defined, but eh.
Also it's super annoying that they split it up into client/server like that.

@dignifiedquire
Copy link
Contributor Author

Going to wait with pushing this forward until we know if rustls/rustls#2258 might happen

@dignifiedquire dignifiedquire removed this from the v0.30.0 milestone Dec 10, 2024
@dignifiedquire dignifiedquire self-assigned this Feb 10, 2025
@dignifiedquire dignifiedquire added this to the v0.33.0 milestone Feb 10, 2025
@dignifiedquire
Copy link
Contributor Author

Going to wait with pushing this forward until we know if rustls/rustls#2258 might happen

looks like this is not happening, or at least not soon, so moving forward with this

@dignifiedquire dignifiedquire marked this pull request as ready for review February 11, 2025 10:08
@dignifiedquire dignifiedquire changed the title [WIP] feat: implement support for raw public keys in TLS feat(iroh)!: implement support for raw public keys in TLS Feb 11, 2025
this was only used in tests, and those only tested quinn isolation things, which have been removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants