[][src]Struct mio_httpc::HttpcCfg

pub struct HttpcCfg {
    pub der_ca: Vec<Vec<u8>>,
    pub pem_ca: Vec<Vec<u8>>,
    pub cache_buffers: usize,
    pub dns_servers: Vec<SocketAddr>,
    pub pins: Vec<(String, Vec<String>)>,
}

Top level configuration for mio_http.

Fields

der_ca: Vec<Vec<u8>>

Extra root certificates in der format.

pem_ca: Vec<Vec<u8>>

Extra root certificates in pem format.

cache_buffers: usize

Default: 8

Max 8K buffers to keep cached for subsequent requests. Every request requires 2.

dns_servers: Vec<SocketAddr>

Set DNS servers if library can not easily get them from system (like Android). macOS, iOS and unix with /etc/resolv.conf are supported ATM. If none provided and library can't get them, google DNS servers (8.8.8.8:53, 8.8.4.4:53) will be used.

pins: Vec<(String, Vec<String>)>

SSL Pinning. every element is (hostname, vec![pin1,pin2,..])

A pin is formatted as: sha256/base64(subjectPublicKeyInfo)

sha1 is also supported though not recommended.

mio_httpc will check if public key of server matches any of the pins before sending the HTTP request.

Methods

impl HttpcCfg[src]

pub fn new() -> HttpcCfg[src]

pub fn certs_from_path(path: &str) -> Result<HttpcCfg>[src]

Will read pem files (extensions .crt or .pem) from path. Path can be to file or folder.

Trait Implementations

impl Clone for HttpcCfg[src]

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

Performs copy-assignment from source. Read more

impl Default for HttpcCfg[src]

Auto Trait Implementations

impl Send for HttpcCfg

impl Sync for HttpcCfg

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]