(feat): rename example-usage to just example
Some checks failed
CI / rustfmt (push) Successful in 17s
CI / clippy (push) Failing after 1m16s
CI / wasm build (push) Successful in 1m17s
CI / example (push) Successful in 1m29s
CI / test (push) Successful in 1m49s
CI / duplicate code (push) Successful in 12s
CI / web client (push) Failing after 27s
CI / cargo-machete (push) Successful in 1m10s
CI / cargo-deny (push) Failing after 2m20s

(feat): add the example's web-client dist folder to a gitignore
(fix): format issues
(fix): a lot of duplicate code
This commit is contained in:
Alois 2026-06-27 03:20:25 +02:00
commit 89a20044a5
43 changed files with 528 additions and 1619 deletions

View file

@ -52,19 +52,7 @@ fn configure_client_with_cert(
.map_err(|_| CommunicationError::CertificateParseFailed)?;
}
let mut tls_config = RustlsClientConfig::builder()
.with_root_certificates(root_store)
.with_no_client_auth();
tls_config.alpn_protocols = vec![b"h3".to_vec()];
Ok(ClientConfig::builder()
.with_bind_default()
.with_custom_tls(tls_config)
.keep_alive_interval(policy.keep_alive_interval)
.max_idle_timeout(policy.max_idle_timeout)
.map_err(|e| CommunicationError::Other(e.to_string()))?
.build())
client_config_from_roots(root_store, policy)
}
fn configure_client_system_roots(policy: &Policy) -> Result<ClientConfig, CommunicationError> {
@ -77,6 +65,13 @@ fn configure_client_system_roots(policy: &Policy) -> Result<ClientConfig, Commun
root_store.add(cert).ok();
}
client_config_from_roots(root_store, policy)
}
fn client_config_from_roots(
root_store: RootCertStore,
policy: &Policy,
) -> Result<ClientConfig, CommunicationError> {
let mut tls_config = RustlsClientConfig::builder()
.with_root_certificates(root_store)
.with_no_client_auth();