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]
impl Openssl
pub fn with_cert_and_key<C, K>(cert: C, key: K) -> Result<Openssl, SslError> where
C: AsRef<Path>,
K: AsRef<Path>,
[src]
pub 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 Debug for Openssl
[src]
impl Debug for Openssl
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Openssl
[src]
impl Clone for Openssl
fn clone(&self) -> Openssl
[src]
fn clone(&self) -> Openssl
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Default for Openssl
[src]
impl Default for Openssl
impl Ssl for Openssl
[src]
impl Ssl for Openssl
type Stream = SslStream<HttpStream>
The protected stream.
fn wrap_client(&self, stream: HttpStream, host: &str) -> Result<Self::Stream>
[src]
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>
[src]
fn wrap_server(&self, stream: HttpStream) -> Result<Self::Stream>
Wrap a server stream with SSL.