fn configure_server() -> Result<(ServerConfig, Vec<u8>), Box<dyn Error>> {
    let cert = rcgen::generate_simple_self_signed(vec!["localhost".into()]).unwrap();
    let cert_der = cert.serialize_der().unwrap();
    let priv_key = cert.serialize_private_key_der();
    let priv_key = PrivateKey::from_der(&priv_key)?;

    let mut transport_config = TransportConfig::default();
    transport_config.stream_window_uni(0);
    let mut server_config = ServerConfig::default();
    server_config.transport = Arc::new(transport_config);
    let mut cfg_builder = ServerConfigBuilder::new(server_config);
    let cert = Certificate::from_der(&cert_der)?;
    cfg_builder.certificate(CertificateChain::from_certs(vec![cert]), priv_key)?;

    Ok((cfg_builder.build(), cert_der))
}
/// Returns default server configuration along with its certificate.
Returns default server configuration along with its certificate.
Returns default server configuration along with its certificate .
fn configure_server() -> Result<(ServerConfig, Vec<u8>), Box<dyn Error>> {
    let cert = rcgen::generate_simple_self_signed(vec!["localhost".into()]).unwrap();
    let cert_der = cert.serialize_der().unwrap();
    let priv_key = cert.serialize_private_key_der();
    let priv_key = PrivateKey::from_der(&priv_key)?;
    let mut transport_config = TransportConfig::default();
    transport_config.stream_window_uni(0);
    let mut server_config = ServerConfig::default();
    server_config.transport = Arc::new(transport_config);
    let mut cfg_builder = ServerConfigBuilder::new(server_config);
    let cert = Certificate::from_der(&cert_der)?;
    cfg_builder.certificate(CertificateChain::from_certs(vec![cert]), priv_key)?;
    Ok((cfg_builder.build(), cert_der))
}
fn configure_server ( ) -> Result < ( ServerConfig , Vec < u8 > ) , Box < dyn Error > > { let cert = rcgen :: generate_simple_self_signed ( vec ! [ " " into ( ) ] ) . unwrap ( ) ; let cert_der = cert . serialize_der ( ) . unwrap ( ) ; let priv_key = cert . serialize_private_key_der ( ) ; let priv_key = PrivateKey :: from_der ( & priv_key ) ? ; let mut transport_config = TransportConfig :: default ( ) ; transport_config . stream_window_uni ( 0 ) ; let mut server_config = ServerConfig :: default ( ) ; server_config . transport = Arc :: new ( transport_config ) ; let mut cfg_builder = ServerConfigBuilder :: new ( server_config ) ; let cert = Certificate :: from_der ( & cert_der ) ? ; cfg_builder . certificate ( CertificateChain :: from_certs ( vec ! [ cert ] ) , priv_key ) ? ; Ok ( ( cfg_builder . build ( ) , cert_der ) ) }
Returns default server configuration along with its certificate.
Returns default server configuration along with its certificate .