Skip to content

Verify relay TLS against the OS certificate store - #226

Open
pinjun99 wants to merge 1 commit into
reason-machines:mainfrom
pinjun99:fix/relay-platform-verifier-224
Open

pinjun99 wants to merge 1 commit into
reason-machines:mainfrom
pinjun99:fix/relay-platform-verifier-224

Conversation

@pinjun99

Copy link
Copy Markdown

Fixes #224

What

The issue's hypothesis holds at the source level: in iroh-relay 1.4.1, CaTlsConfig::default() is Mode::EmbeddedWebPki (Mozilla roots compiled in), and the endpoint in src/net.rs never sets a CA config, so relay TLS only trusts the embedded roots. A root installed only in the OS store (a company TLS-inspecting proxy, antivirus HTTPS scanning) is never consulted.

This PR:

  • enables iroh's platform-verifier feature (iroh = { version = "1.4", features = ["platform-verifier"] }), which turns on iroh-relay/platform-verifier; rustls-platform-verifier is already in the lock file through reqwest, so Cargo.lock only gains one dependency edge;
  • builds the endpoint with .ca_tls_config(iroh::tls::CaTlsConfig::system()), for both the Minimal and N0 presets.

Certificate verification stays on; it now uses the OS's verifier (as reqwest already does) instead of the embedded list.

Testing

  • cargo fmt --check: passes
  • cargo clippy --all-targets --locked -- -D warnings: passes
  • cargo test --locked: passes (341 + 5 + 2 tests)

Not tested: I did not run the engine behind a TLS-inspecting proxy with a root only in the OS store, so the end-to-end fix for the Windows case in the issue is not reproduced. The confirming setup described in the issue (local TLS-terminating proxy, throwaway root added with certutil -addstore Root / security add-trusted-cert) would verify it.

AI assistance

I used OpenAI Codex to help make this change. I read the iroh-relay TLS code, reviewed the diff and ran the checks above myself.

Enable iroh's platform-verifier feature and build the endpoint with
CaTlsConfig::system(), so relay connections trust roots installed only in
the OS store (TLS-inspecting proxies, antivirus HTTPS scanning) instead of
only iroh's embedded webpki roots. Verification stays on.

Fixes reason-machines#224
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.

Relay connections may not trust the operating system's certificate store (iroh-relay depends on webpki-roots)

1 participant