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: Arc<SslContext>

The SslContext from openssl crate.

Methods

impl Openssl
[src]

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

Ease creating an Openssl with a certificate and key.

Trait Implementations

impl Clone for Openssl
[src]

fn clone(&self) -> Openssl

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for Openssl
[src]

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

Formats the value using the given formatter.

impl Default for Openssl
[src]

fn default() -> Openssl

Returns the "default value" for a type. Read more

impl Ssl for Openssl
[src]

type Stream = SslStream<HttpStream>

The protected stream.

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

Wrap a client stream with SSL.

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

Wrap a server stream with SSL.