Extract the DER-encoded server certificate from a TLS session.
(tls: &tokio_rustls::client::TlsStream<TcpStream>)
| 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() { |
no outgoing calls