MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / https_client_no_cert

Function https_client_no_cert

crates/openshell-server/tests/edge_tunnel_auth.rs:138–154  ·  view source on GitHub ↗

Build an HTTPS client *without* a client cert (simulates Cloudflare tunnel).

(
    ca_pem: &[u8],
)

Source from the content-addressed store, hash-verified

136
137/// Build an HTTPS client *without* a client cert (simulates Cloudflare tunnel).
138fn https_client_no_cert(
139 ca_pem: &[u8],
140) -> Client<
141 hyper_rustls::HttpsConnector<hyper_util::client::legacy::connect::HttpConnector>,
142 Empty<Bytes>,
143> {
144 let roots = build_tls_root(ca_pem);
145 let tls_config = rustls::ClientConfig::builder()
146 .with_root_certificates(roots)
147 .with_no_client_auth();
148 let https = HttpsConnectorBuilder::new()
149 .with_tls_config(tls_config)
150 .https_only()
151 .enable_http1()
152 .build();
153 Client::builder(TokioExecutor::new()).build(https)
154}
155
156// ===========================================================================
157// Tests

Calls 2

build_tls_rootFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected