Closed bugnano closed 10 months ago
I'd like to be able to do the following:
let certificate = Certificate::load(&certfile, &keyfile).await?; let endpoints = addrs_iter .map(|bind_address| { let config = ServerConfig::builder() .with_bind_address(bind_address) .with_certificate(certificate.clone()) .keep_alive_interval(Some(Duration::from_secs(3))) .build(); Ok((Endpoint::server(config)?, bind_address)) }) .collect::<Result<Vec<(Endpoint<Server>, SocketAddr)>, io::Error>>()?;
So that I can load the certificates from disk only once, and be able to create multiple endpoints with the same certificates.
I was thinking that if the Certificate struct implements the Clone trait, then this would be possible, right?
Definitely! Thanks for the feedback
I'd like to be able to do the following:
So that I can load the certificates from disk only once, and be able to create multiple endpoints with the same certificates.
I was thinking that if the Certificate struct implements the Clone trait, then this would be possible, right?