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>)>,
}
Expand description
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.