Skip to content

feat: support custom root certificates in WASM bindings#1119

Open
heeckhau wants to merge 2 commits intomainfrom
feat/custom-root-certs
Open

feat: support custom root certificates in WASM bindings#1119
heeckhau wants to merge 2 commits intomainfrom
feat/custom-root-certs

Conversation

@heeckhau
Copy link
Copy Markdown
Member

@heeckhau heeckhau commented Mar 7, 2026

Summary

  • Add root_certs: Option<Vec<Vec<u8>>> to ProverConfig and VerifierConfig in sdk-core and WASM bindings, allowing custom DER-encoded root certificates for TLS server verification
  • When not provided, Mozilla root certificates are used as the default (gated behind mozilla-certs feature)
  • Remove stale tests.rs and unused test feature from wasm crate, along with unused dependencies
  • Add sdk_core harness test plugin exercising the full MPC-TLS flow with custom root certs

Closes #618

JS usage

const prover = new Prover({
  serverName: "example.com",
  maxSentData: 4096,
  maxRecvData: 16384,
  network: "Latency",
  // Custom root certs (DER-encoded) — omit for Mozilla defaults
  rootCerts: [myCustomCaDerBytes],
});

Test plan

  • cargo check --workspace passes
  • cargo test -p tlsn-sdk-core — 28 tests pass
  • cargo test -p tlsn -- --ignored — full integration test passes
  • Harness sdk_core test on native target (./bin/runner test --name sdk_core)
  • Harness sdk_core test on browser target (./bin/runner --target browser test --name sdk_core)

🤖 Generated with Claude Code

@heeckhau heeckhau force-pushed the feat/custom-root-certs branch from c321b60 to 5c6a917 Compare March 9, 2026 10:33
Base automatically changed from injectio to main March 10, 2026 17:17
Add `root_certs` option to `ProverConfig` and `VerifierConfig` in
sdk-core and WASM bindings, allowing custom DER-encoded root
certificates for TLS server verification. When not provided, Mozilla
root certificates are used as the default.

- Add `root_certs: Option<Vec<Vec<u8>>>` to sdk-core configs with
  builder methods
- Add `mozilla-certs` feature flag to sdk-core for conditional fallback
- Wire custom root certs through WASM prover/verifier config layers
- Remove stale `tests.rs` and unused `test` feature from wasm crate
- Clean up unused wasm dependencies (tlsn, tlsn-core, tlsn-tls-core,
  tlsn-server-fixture-certs)
- Add `sdk_core` harness test plugin exercising the full MPC-TLS flow
  with custom root certs

Closes #618
@heeckhau heeckhau force-pushed the feat/custom-root-certs branch from 5c6a917 to f870a70 Compare March 23, 2026 12:35
…builders

- ProverConfigBuilder::build and VerifierConfigBuilder::build now
  return Result, resolving root certificates eagerly instead of at
  protocol time. Missing certs without mozilla-certs feature is now
  caught at config construction.
- Custom DER certificates are validated via webpki::anchor_from_trusted_cert
  so invalid bytes produce a clear error with index, not a cryptic TLS
  handshake failure.
- Added unit tests for invalid DER rejection, mozilla fallback, and
  missing-certs error path.
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.

1 participant