Fix warnings now set_single_cert yields a Result
This commit is contained in:
parent
5d6d474080
commit
a8e1e9ac35
@ -45,7 +45,8 @@ fn main() {
|
||||
let flag_echo = matches.occurrences_of("echo") > 0;
|
||||
|
||||
let mut config = ServerConfig::new(NoClientAuth::new());
|
||||
config.set_single_cert(load_certs(cert_file), load_keys(key_file).remove(0));
|
||||
config.set_single_cert(load_certs(cert_file), load_keys(key_file).remove(0))
|
||||
.expect("invalid key or certificate");
|
||||
let arc_config = Arc::new(config);
|
||||
|
||||
let socket = TcpListener::bind(&addr).unwrap();
|
||||
|
@ -26,7 +26,8 @@ fn start_server(cert: Vec<Certificate>, rsa: PrivateKey) -> SocketAddr {
|
||||
use tokio::io as aio;
|
||||
|
||||
let mut config = ServerConfig::new(rustls::NoClientAuth::new());
|
||||
config.set_single_cert(cert, rsa);
|
||||
config.set_single_cert(cert, rsa)
|
||||
.expect("invalid key or certificate");
|
||||
let config = Arc::new(config);
|
||||
|
||||
let (send, recv) = channel();
|
||||
|
Loading…
Reference in New Issue
Block a user