Function hyper_from_pem_files

Source
pub fn hyper_from_pem_files<P: AsRef<Path>, Q: AsRef<Path>>(
    cert_file: P,
    key_file: Q,
    protocols: Protocols,
    addr: &SocketAddr,
) -> Result<Builder<TlsListener>, Error>
Expand description

The highest level function. Creates the Hyper server builder.

Certificates and key will be obtained from files. Protocols determines list of protocols that will be supported. Typical usage is:

let server = hyper_from_pem_files("cert.pem", "key.pem", Protocols::ALL, &addr)?
            .serve(make_svc);