cert work
This commit is contained in:
@@ -37,19 +37,12 @@ pub fn init_endpoint(port: u16, data_path: &Path) -> Endpoint {
|
||||
panic!("failed to read certificate: {}", e);
|
||||
}
|
||||
};
|
||||
// let server_crypto = quinn::rustls::ServerConfig::builder()
|
||||
// .with_no_client_auth()
|
||||
// .with_single_cert(vec![cert], key)
|
||||
// .unwrap();
|
||||
//
|
||||
// let server_config = quinn::ServerConfig::with_crypto(Arc::new(
|
||||
// QuicServerConfig::try_from(server_crypto).unwrap(),
|
||||
// ));
|
||||
|
||||
print!("cert hex: ");
|
||||
for x in cert.iter() {
|
||||
print!("{:x}", x);
|
||||
}
|
||||
println!();
|
||||
let server_config = ServerConfig::with_single_cert(vec![cert], key).unwrap();
|
||||
// let transport_config = Arc::get_mut(&mut server_config.transport).unwrap();
|
||||
// transport_config.max_concurrent_uni_streams(0_u8.into());
|
||||
|
||||
let server_socket: SocketAddr = SocketAddr::V6(SocketAddrV6::new(SERVER_HOST, port, 0, 0));
|
||||
quinn::Endpoint::server(server_config, server_socket).unwrap()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user