From d179150c39092c0ac60075c26699cc85528f842f Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 21 Aug 2024 08:50:08 +0000 Subject: [PATCH] refactor: modularize server-fixture (#563) * refactor: modularize server-fixture * small fixes * Update crates/server-fixture/server/Cargo.toml add newline Co-authored-by: sinu.eth <65924192+sinui0@users.noreply.github.com> --------- Co-authored-by: Ubuntu Co-authored-by: sinu.eth <65924192+sinui0@users.noreply.github.com> --- Cargo.toml | 6 ++++-- crates/benches/Cargo.toml | 1 + crates/benches/bin/prover.rs | 5 +++-- crates/benches/bin/verifier.rs | 10 +++++----- crates/server-fixture/certs/Cargo.toml | 4 ++++ crates/server-fixture/certs/src/lib.rs | 8 ++++++++ crates/server-fixture/{ => certs}/src/tls/README.md | 0 .../server-fixture/{ => certs}/src/tls/openssl.cnf | 0 .../server-fixture/{ => certs}/src/tls/root_ca.crt | 0 .../server-fixture/{ => certs}/src/tls/root_ca.key | 0 .../server-fixture/{ => certs}/src/tls/root_ca.srl | 0 .../{ => certs}/src/tls/root_ca_cert.der | Bin .../{ => certs}/src/tls/test_server.crt | 0 .../{ => certs}/src/tls/test_server.csr | 0 .../{ => certs}/src/tls/test_server.key | 0 .../{ => certs}/src/tls/test_server_cert.der | Bin .../{ => certs}/src/tls/test_server_private_key.der | Bin crates/server-fixture/{ => server}/Cargo.toml | 2 ++ crates/server-fixture/{ => server}/README.md | 0 .../server-fixture/{ => server}/src/data/.gitignore | 0 .../server-fixture/{ => server}/src/data/1kb.json | 0 .../server-fixture/{ => server}/src/data/4kb.html | 0 .../server-fixture/{ => server}/src/data/4kb.json | 0 .../server-fixture/{ => server}/src/data/8kb.json | 0 crates/server-fixture/{ => server}/src/lib.rs | 9 +-------- crates/server-fixture/{ => server}/src/main.rs | 0 crates/tests-integration/Cargo.toml | 1 + crates/tests-integration/tests/defer_decryption.rs | 8 +++++--- crates/tests-integration/tests/notarize.rs | 10 ++++++---- crates/tests-integration/tests/verify.rs | 12 +++++++----- crates/wasm-test-runner/Cargo.toml | 1 + crates/wasm-test-runner/src/server_fixture.rs | 2 ++ crates/wasm-test-runner/src/tlsn_fixture.rs | 11 +++++------ crates/wasm/Cargo.toml | 1 + crates/wasm/src/tests.rs | 4 +--- 35 files changed, 57 insertions(+), 38 deletions(-) create mode 100644 crates/server-fixture/certs/Cargo.toml create mode 100644 crates/server-fixture/certs/src/lib.rs rename crates/server-fixture/{ => certs}/src/tls/README.md (100%) rename crates/server-fixture/{ => certs}/src/tls/openssl.cnf (100%) rename crates/server-fixture/{ => certs}/src/tls/root_ca.crt (100%) rename crates/server-fixture/{ => certs}/src/tls/root_ca.key (100%) rename crates/server-fixture/{ => certs}/src/tls/root_ca.srl (100%) rename crates/server-fixture/{ => certs}/src/tls/root_ca_cert.der (100%) rename crates/server-fixture/{ => certs}/src/tls/test_server.crt (100%) rename crates/server-fixture/{ => certs}/src/tls/test_server.csr (100%) rename crates/server-fixture/{ => certs}/src/tls/test_server.key (100%) rename crates/server-fixture/{ => certs}/src/tls/test_server_cert.der (100%) rename crates/server-fixture/{ => certs}/src/tls/test_server_private_key.der (100%) rename crates/server-fixture/{ => server}/Cargo.toml (91%) rename crates/server-fixture/{ => server}/README.md (100%) rename crates/server-fixture/{ => server}/src/data/.gitignore (100%) rename crates/server-fixture/{ => server}/src/data/1kb.json (100%) rename crates/server-fixture/{ => server}/src/data/4kb.html (100%) rename crates/server-fixture/{ => server}/src/data/4kb.json (100%) rename crates/server-fixture/{ => server}/src/data/8kb.json (100%) rename crates/server-fixture/{ => server}/src/lib.rs (87%) rename crates/server-fixture/{ => server}/src/main.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 7381a8882b..e575d542a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,8 @@ members = [ "crates/notary/server", "crates/notary/tests-integration", "crates/prover", - "crates/server-fixture", + "crates/server-fixture/certs", + "crates/server-fixture/server", "crates/tests-integration", "crates/tls/backend", "crates/tls/client", @@ -47,7 +48,8 @@ tlsn-hmac-sha256 = { path = "crates/components/hmac-sha256" } tlsn-hmac-sha256-circuits = { path = "crates/components/hmac-sha256-circuits" } tlsn-key-exchange = { path = "crates/components/key-exchange" } tlsn-prover = { path = "crates/prover" } -tlsn-server-fixture = { path = "crates/server-fixture" } +tlsn-server-fixture = { path = "crates/server-fixture/server" } +tlsn-server-fixture-certs = { path = "crates/server-fixture/certs" } tlsn-stream-cipher = { path = "crates/components/stream-cipher" } tlsn-tls-backend = { path = "crates/tls/backend" } tlsn-tls-client = { path = "crates/tls/client" } diff --git a/crates/benches/Cargo.toml b/crates/benches/Cargo.toml index 2082aca4ec..c0991da4d5 100644 --- a/crates/benches/Cargo.toml +++ b/crates/benches/Cargo.toml @@ -14,6 +14,7 @@ tlsn-common = { workspace = true } tlsn-core = { workspace = true } tlsn-prover = { workspace = true } tlsn-server-fixture = { workspace = true } +tlsn-server-fixture-certs = { workspace = true } tlsn-tls-core = { workspace = true } tlsn-verifier = { workspace = true } tokio = { workspace = true, features = [ diff --git a/crates/benches/bin/prover.rs b/crates/benches/bin/prover.rs index bf239491ba..48166e49b6 100644 --- a/crates/benches/bin/prover.rs +++ b/crates/benches/bin/prover.rs @@ -17,7 +17,8 @@ use tlsn_benches::{ use tlsn_common::config::ProtocolConfig; use tlsn_core::Direction; -use tlsn_server_fixture::{CA_CERT_DER, SERVER_DOMAIN}; +use tlsn_server_fixture::bind; +use tlsn_server_fixture_certs::{CA_CERT_DER, SERVER_DOMAIN}; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_util::{ compat::TokioAsyncReadCompatExt, @@ -112,7 +113,7 @@ async fn run_instance set_interface(PROVER_INTERFACE, upload, 1, upload_delay)?; let (client_conn, server_conn) = tokio::io::duplex(2 << 16); - tokio::spawn(tlsn_server_fixture::bind(server_conn.compat())); + tokio::spawn(bind(server_conn.compat())); let start_time = Instant::now(); diff --git a/crates/benches/bin/verifier.rs b/crates/benches/bin/verifier.rs index 9377d1d0ab..7f33764871 100644 --- a/crates/benches/bin/verifier.rs +++ b/crates/benches/bin/verifier.rs @@ -1,16 +1,16 @@ use anyhow::Context; +use tokio::io::{AsyncRead, AsyncWrite}; +use tokio_util::compat::TokioAsyncReadCompatExt; +use tracing_subscriber::{fmt::format::FmtSpan, EnvFilter}; + use tls_core::verify::WebPkiVerifier; use tlsn_benches::{ config::{BenchInstance, Config}, set_interface, VERIFIER_INTERFACE, }; use tlsn_common::config::ProtocolConfigValidator; -use tlsn_server_fixture::CA_CERT_DER; -use tokio::io::{AsyncRead, AsyncWrite}; -use tokio_util::compat::TokioAsyncReadCompatExt; - +use tlsn_server_fixture_certs::CA_CERT_DER; use tlsn_verifier::tls::{Verifier, VerifierConfig}; -use tracing_subscriber::{fmt::format::FmtSpan, EnvFilter}; #[tokio::main] async fn main() -> anyhow::Result<()> { diff --git a/crates/server-fixture/certs/Cargo.toml b/crates/server-fixture/certs/Cargo.toml new file mode 100644 index 0000000000..25ef66064f --- /dev/null +++ b/crates/server-fixture/certs/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "tlsn-server-fixture-certs" +version = "0.1.0" +edition = "2021" diff --git a/crates/server-fixture/certs/src/lib.rs b/crates/server-fixture/certs/src/lib.rs new file mode 100644 index 0000000000..b090b68772 --- /dev/null +++ b/crates/server-fixture/certs/src/lib.rs @@ -0,0 +1,8 @@ +/// A certificate authority certificate fixture. +pub static CA_CERT_DER: &[u8] = include_bytes!("tls/root_ca_cert.der"); +/// A server certificate (domain=test-server.io) fixture. +pub static SERVER_CERT_DER: &[u8] = include_bytes!("tls/test_server_cert.der"); +/// A server private key fixture. +pub static SERVER_KEY_DER: &[u8] = include_bytes!("tls/test_server_private_key.der"); +/// The domain name bound to the server certificate. +pub static SERVER_DOMAIN: &str = "test-server.io"; diff --git a/crates/server-fixture/src/tls/README.md b/crates/server-fixture/certs/src/tls/README.md similarity index 100% rename from crates/server-fixture/src/tls/README.md rename to crates/server-fixture/certs/src/tls/README.md diff --git a/crates/server-fixture/src/tls/openssl.cnf b/crates/server-fixture/certs/src/tls/openssl.cnf similarity index 100% rename from crates/server-fixture/src/tls/openssl.cnf rename to crates/server-fixture/certs/src/tls/openssl.cnf diff --git a/crates/server-fixture/src/tls/root_ca.crt b/crates/server-fixture/certs/src/tls/root_ca.crt similarity index 100% rename from crates/server-fixture/src/tls/root_ca.crt rename to crates/server-fixture/certs/src/tls/root_ca.crt diff --git a/crates/server-fixture/src/tls/root_ca.key b/crates/server-fixture/certs/src/tls/root_ca.key similarity index 100% rename from crates/server-fixture/src/tls/root_ca.key rename to crates/server-fixture/certs/src/tls/root_ca.key diff --git a/crates/server-fixture/src/tls/root_ca.srl b/crates/server-fixture/certs/src/tls/root_ca.srl similarity index 100% rename from crates/server-fixture/src/tls/root_ca.srl rename to crates/server-fixture/certs/src/tls/root_ca.srl diff --git a/crates/server-fixture/src/tls/root_ca_cert.der b/crates/server-fixture/certs/src/tls/root_ca_cert.der similarity index 100% rename from crates/server-fixture/src/tls/root_ca_cert.der rename to crates/server-fixture/certs/src/tls/root_ca_cert.der diff --git a/crates/server-fixture/src/tls/test_server.crt b/crates/server-fixture/certs/src/tls/test_server.crt similarity index 100% rename from crates/server-fixture/src/tls/test_server.crt rename to crates/server-fixture/certs/src/tls/test_server.crt diff --git a/crates/server-fixture/src/tls/test_server.csr b/crates/server-fixture/certs/src/tls/test_server.csr similarity index 100% rename from crates/server-fixture/src/tls/test_server.csr rename to crates/server-fixture/certs/src/tls/test_server.csr diff --git a/crates/server-fixture/src/tls/test_server.key b/crates/server-fixture/certs/src/tls/test_server.key similarity index 100% rename from crates/server-fixture/src/tls/test_server.key rename to crates/server-fixture/certs/src/tls/test_server.key diff --git a/crates/server-fixture/src/tls/test_server_cert.der b/crates/server-fixture/certs/src/tls/test_server_cert.der similarity index 100% rename from crates/server-fixture/src/tls/test_server_cert.der rename to crates/server-fixture/certs/src/tls/test_server_cert.der diff --git a/crates/server-fixture/src/tls/test_server_private_key.der b/crates/server-fixture/certs/src/tls/test_server_private_key.der similarity index 100% rename from crates/server-fixture/src/tls/test_server_private_key.der rename to crates/server-fixture/certs/src/tls/test_server_private_key.der diff --git a/crates/server-fixture/Cargo.toml b/crates/server-fixture/server/Cargo.toml similarity index 91% rename from crates/server-fixture/Cargo.toml rename to crates/server-fixture/server/Cargo.toml index dc0a5bd582..dd617b8815 100644 --- a/crates/server-fixture/Cargo.toml +++ b/crates/server-fixture/server/Cargo.toml @@ -14,6 +14,8 @@ tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } tokio-util = { workspace = true, features = ["compat", "io"] } tower-service = { version = "0.3" } +tlsn-server-fixture-certs = { workspace = true } + [[bin]] name = "main" path = "src/main.rs" diff --git a/crates/server-fixture/README.md b/crates/server-fixture/server/README.md similarity index 100% rename from crates/server-fixture/README.md rename to crates/server-fixture/server/README.md diff --git a/crates/server-fixture/src/data/.gitignore b/crates/server-fixture/server/src/data/.gitignore similarity index 100% rename from crates/server-fixture/src/data/.gitignore rename to crates/server-fixture/server/src/data/.gitignore diff --git a/crates/server-fixture/src/data/1kb.json b/crates/server-fixture/server/src/data/1kb.json similarity index 100% rename from crates/server-fixture/src/data/1kb.json rename to crates/server-fixture/server/src/data/1kb.json diff --git a/crates/server-fixture/src/data/4kb.html b/crates/server-fixture/server/src/data/4kb.html similarity index 100% rename from crates/server-fixture/src/data/4kb.html rename to crates/server-fixture/server/src/data/4kb.html diff --git a/crates/server-fixture/src/data/4kb.json b/crates/server-fixture/server/src/data/4kb.json similarity index 100% rename from crates/server-fixture/src/data/4kb.json rename to crates/server-fixture/server/src/data/4kb.json diff --git a/crates/server-fixture/src/data/8kb.json b/crates/server-fixture/server/src/data/8kb.json similarity index 100% rename from crates/server-fixture/src/data/8kb.json rename to crates/server-fixture/server/src/data/8kb.json diff --git a/crates/server-fixture/src/lib.rs b/crates/server-fixture/server/src/lib.rs similarity index 87% rename from crates/server-fixture/src/lib.rs rename to crates/server-fixture/server/src/lib.rs index a0ce0602af..1ac44f3975 100644 --- a/crates/server-fixture/src/lib.rs +++ b/crates/server-fixture/server/src/lib.rs @@ -25,14 +25,7 @@ use hyper_util::rt::TokioIo; use tokio_util::compat::FuturesAsyncReadCompatExt; use tower_service::Service; -/// A certificate authority certificate fixture. -pub static CA_CERT_DER: &[u8] = include_bytes!("tls/root_ca_cert.der"); -/// A server certificate (domain=test-server.io) fixture. -pub static SERVER_CERT_DER: &[u8] = include_bytes!("tls/test_server_cert.der"); -/// A server private key fixture. -pub static SERVER_KEY_DER: &[u8] = include_bytes!("tls/test_server_private_key.der"); -/// The domain name bound to the server certificate. -pub static SERVER_DOMAIN: &str = "test-server.io"; +use tlsn_server_fixture_certs::*; struct AppState { shutdown: Option>, diff --git a/crates/server-fixture/src/main.rs b/crates/server-fixture/server/src/main.rs similarity index 100% rename from crates/server-fixture/src/main.rs rename to crates/server-fixture/server/src/main.rs diff --git a/crates/tests-integration/Cargo.toml b/crates/tests-integration/Cargo.toml index 23c7d325f2..7c9c5bccd8 100644 --- a/crates/tests-integration/Cargo.toml +++ b/crates/tests-integration/Cargo.toml @@ -8,6 +8,7 @@ publish = false tlsn-core = { workspace = true } tlsn-prover = { workspace = true } tlsn-server-fixture = { workspace = true } +tlsn-server-fixture-certs = { workspace = true } tlsn-tls-core = { workspace = true } tlsn-utils = { workspace = true } tlsn-verifier = { workspace = true } diff --git a/crates/tests-integration/tests/defer_decryption.rs b/crates/tests-integration/tests/defer_decryption.rs index 2cc73da5e7..13db889adf 100644 --- a/crates/tests-integration/tests/defer_decryption.rs +++ b/crates/tests-integration/tests/defer_decryption.rs @@ -1,7 +1,9 @@ -use futures::{AsyncReadExt, AsyncWriteExt}; use tlsn_prover::tls::{Prover, ProverConfig}; -use tlsn_server_fixture::{CA_CERT_DER, SERVER_DOMAIN}; +use tlsn_server_fixture::bind; +use tlsn_server_fixture_certs::{CA_CERT_DER, SERVER_DOMAIN}; use tlsn_verifier::tls::{Verifier, VerifierConfig}; + +use futures::{AsyncReadExt, AsyncWriteExt}; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_util::compat::TokioAsyncReadCompatExt; use tracing::instrument; @@ -20,7 +22,7 @@ async fn test_defer_decryption() { async fn prover(notary_socket: T) { let (client_socket, server_socket) = tokio::io::duplex(2 << 16); - let server_task = tokio::spawn(tlsn_server_fixture::bind(server_socket.compat())); + let server_task = tokio::spawn(bind(server_socket.compat())); let mut root_store = tls_core::anchors::RootCertStore::empty(); root_store diff --git a/crates/tests-integration/tests/notarize.rs b/crates/tests-integration/tests/notarize.rs index 70abd5c86f..8338e1119c 100644 --- a/crates/tests-integration/tests/notarize.rs +++ b/crates/tests-integration/tests/notarize.rs @@ -1,9 +1,11 @@ +use tlsn_prover::tls::{Prover, ProverConfig}; +use tlsn_server_fixture::bind; +use tlsn_server_fixture_certs::{CA_CERT_DER, SERVER_DOMAIN}; +use tlsn_verifier::tls::{Verifier, VerifierConfig}; + use http_body_util::{BodyExt as _, Empty}; use hyper::{body::Bytes, Request, StatusCode}; use hyper_util::rt::TokioIo; -use tlsn_prover::tls::{Prover, ProverConfig}; -use tlsn_server_fixture::{CA_CERT_DER, SERVER_DOMAIN}; -use tlsn_verifier::tls::{Verifier, VerifierConfig}; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_util::compat::{FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt}; use tracing::instrument; @@ -22,7 +24,7 @@ async fn notarize() { async fn prover(notary_socket: T) { let (client_socket, server_socket) = tokio::io::duplex(2 << 16); - let server_task = tokio::spawn(tlsn_server_fixture::bind(server_socket.compat())); + let server_task = tokio::spawn(bind(server_socket.compat())); let mut root_store = tls_core::anchors::RootCertStore::empty(); root_store diff --git a/crates/tests-integration/tests/verify.rs b/crates/tests-integration/tests/verify.rs index c011fa206d..64f21da8ca 100644 --- a/crates/tests-integration/tests/verify.rs +++ b/crates/tests-integration/tests/verify.rs @@ -1,11 +1,13 @@ -use http_body_util::{BodyExt as _, Empty}; -use hyper::{body::Bytes, Request, StatusCode}; -use hyper_util::rt::TokioIo; use tls_core::{anchors::RootCertStore, verify::WebPkiVerifier}; use tlsn_core::{proof::SessionInfo, Direction, RedactedTranscript}; use tlsn_prover::tls::{Prover, ProverConfig}; -use tlsn_server_fixture::{CA_CERT_DER, SERVER_DOMAIN}; +use tlsn_server_fixture::bind; +use tlsn_server_fixture_certs::{CA_CERT_DER, SERVER_DOMAIN}; use tlsn_verifier::tls::{Verifier, VerifierConfig}; + +use http_body_util::{BodyExt as _, Empty}; +use hyper::{body::Bytes, Request, StatusCode}; +use hyper_util::rt::TokioIo; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_util::compat::{FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt}; use tracing::instrument; @@ -34,7 +36,7 @@ async fn verify() { async fn prover(notary_socket: T) { let (client_socket, server_socket) = tokio::io::duplex(1 << 16); - let server_task = tokio::spawn(tlsn_server_fixture::bind(server_socket.compat())); + let server_task = tokio::spawn(bind(server_socket.compat())); let mut root_store = RootCertStore::empty(); root_store diff --git a/crates/wasm-test-runner/Cargo.toml b/crates/wasm-test-runner/Cargo.toml index 0b625c7d05..d515bcd86d 100644 --- a/crates/wasm-test-runner/Cargo.toml +++ b/crates/wasm-test-runner/Cargo.toml @@ -9,6 +9,7 @@ tlsn-common = { workspace = true } tlsn-core = { workspace = true } tlsn-prover = { workspace = true } tlsn-server-fixture = { workspace = true } +tlsn-server-fixture-certs = { workspace = true } tlsn-tls-core = { workspace = true } tlsn-verifier = { workspace = true } diff --git a/crates/wasm-test-runner/src/server_fixture.rs b/crates/wasm-test-runner/src/server_fixture.rs index da9756350b..6a56fb6c08 100644 --- a/crates/wasm-test-runner/src/server_fixture.rs +++ b/crates/wasm-test-runner/src/server_fixture.rs @@ -1,5 +1,7 @@ use std::{env, net::IpAddr}; +use tlsn_server_fixture; + use anyhow::Result; use futures::Future; use tokio::net::TcpListener; diff --git a/crates/wasm-test-runner/src/tlsn_fixture.rs b/crates/wasm-test-runner/src/tlsn_fixture.rs index 2e6a79e302..2a1c068a83 100644 --- a/crates/wasm-test-runner/src/tlsn_fixture.rs +++ b/crates/wasm-test-runner/src/tlsn_fixture.rs @@ -1,13 +1,14 @@ use std::{env, net::IpAddr}; -use anyhow::Result; -use futures::{AsyncReadExt, AsyncWriteExt, Future}; use tls_core::{anchors::RootCertStore, verify::WebPkiVerifier}; use tlsn_common::config::{ProtocolConfig, ProtocolConfigValidator}; use tlsn_core::Direction; use tlsn_prover::tls::{Prover, ProverConfig}; -use tlsn_server_fixture::{CA_CERT_DER, SERVER_DOMAIN}; +use tlsn_server_fixture_certs::{CA_CERT_DER, SERVER_DOMAIN}; use tlsn_verifier::tls::{Verifier, VerifierConfig}; + +use anyhow::Result; +use futures::{AsyncReadExt, AsyncWriteExt, Future}; use tokio::net::{TcpListener, TcpStream}; use tokio_util::compat::TokioAsyncReadCompatExt; use tracing::{info, instrument}; @@ -66,9 +67,7 @@ pub async fn start() -> Result>> { async fn handle_verifier(io: TcpStream) -> Result<()> { let mut root_store = RootCertStore::empty(); root_store - .add(&tls_core::key::Certificate( - tlsn_server_fixture::CA_CERT_DER.to_vec(), - )) + .add(&tls_core::key::Certificate(CA_CERT_DER.to_vec())) .unwrap(); let config_validator = ProtocolConfigValidator::builder() diff --git a/crates/wasm/Cargo.toml b/crates/wasm/Cargo.toml index 26b0db079e..93b19ef520 100644 --- a/crates/wasm/Cargo.toml +++ b/crates/wasm/Cargo.toml @@ -22,6 +22,7 @@ no-bundler = ["wasm-bindgen-rayon/no-bundler"] tlsn-common = { path = "../common" } tlsn-core = { path = "../core" } tlsn-prover = { path = "../prover" } +tlsn-server-fixture-certs = { workspace = true } tlsn-tls-client-async = { path = "../tls/client-async" } tlsn-tls-core = { path = "../tls/core" } tlsn-verifier = { path = "../verifier" } diff --git a/crates/wasm/src/tests.rs b/crates/wasm/src/tests.rs index 88bffe74fd..eaffd30049 100644 --- a/crates/wasm/src/tests.rs +++ b/crates/wasm/src/tests.rs @@ -5,6 +5,7 @@ use std::collections::HashMap; use tls_core::verify::WebPkiVerifier; use tlsn_common::config::{ProtocolConfig, ProtocolConfigValidator}; use tlsn_prover::tls::{Prover, ProverConfig}; +use tlsn_server_fixture_certs::{CA_CERT_DER, SERVER_DOMAIN}; use tlsn_verifier::tls::{Verifier, VerifierConfig}; use wasm_bindgen::prelude::*; @@ -14,9 +15,6 @@ use crate::{ verifier::JsVerifier, }; -static CA_CERT_DER: &[u8] = include_bytes!("../../server-fixture/src/tls/root_ca_cert.der"); -static SERVER_DOMAIN: &str = "test-server.io"; - #[wasm_bindgen] pub async fn test_prove() -> Result<(), JsValue> { let mut root_store = tls_core::anchors::RootCertStore::empty();