add cert_file option to quic base code
This commit is contained in:
parent
15055d13cb
commit
bd39906b75
|
|
@ -15,8 +15,9 @@ use rustls::pki_types::pem::PemObject;
|
|||
/// - server certificate serialized into DER format
|
||||
pub fn make_server_endpoint(
|
||||
bind_addr: SocketAddr,
|
||||
cert_file: Option<String>
|
||||
) -> Result<(Endpoint, CertificateDer<'static>), Box<dyn Error + Send + Sync + 'static>> {
|
||||
let (server_config, server_cert) = configure_server()?;
|
||||
let (server_config, server_cert) = configure_server(cert_file)?;
|
||||
let endpoint = Endpoint::server(server_config, bind_addr)?;
|
||||
Ok((endpoint, server_cert))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue