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

Function peer_cert_der

crates/openshell-server/src/tls.rs:388–392  ·  view source on GitHub ↗

Extract the DER-encoded server certificate from a TLS session.

(tls: &tokio_rustls::client::TlsStream<TcpStream>)

Source from the content-addressed store, hash-verified

386
387 /// Extract the DER-encoded server certificate from a TLS session.
388 fn peer_cert_der(tls: &tokio_rustls::client::TlsStream<TcpStream>) -> Vec<u8> {
389 tls.get_ref().1.peer_certificates().expect("no peer certs")[0]
390 .as_ref()
391 .to_vec()
392 }
393
394 #[test]
395 fn test_build_server_config() {

Calls

no outgoing calls