Struct hyper::net::Openssl [] [src]

pub struct Openssl {
    pub context: Arc<SslContext>,
}

An implementation of Ssl for OpenSSL.

Example

use hyper::Server;
use hyper::net::Openssl;

let ssl = Openssl::with_cert_and_key("/home/foo/cert", "/home/foo/key").unwrap();
Server::https("0.0.0.0:443", ssl).unwrap();

For complete control, create a SslContext with the options you desire and then create `Openssl { context: ctx }

Fields

context

The SslContext from openssl crate.

Methods

impl Openssl

fn with_cert_and_key<C, K>(cert: C, key: K) -> Result<Openssl, SslError> where C: AsRef<Path>, K: AsRef<Path>

Ease creating an Openssl with a certificate and key.

Trait Implementations

impl Default for Openssl

fn default() -> Openssl

impl Ssl for Openssl

type Stream = SslStream<HttpStream>

fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>

fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>

Derived Implementations

impl Clone for Openssl

fn clone(&self) -> Openssl

fn clone_from(&mut self, source: &Self)

impl Debug for Openssl

fn fmt(&self, __arg_0: &mut Formatter) -> Result