pub trait Builder {
    // Required methods
    fn set_root_certificates<C>(builder: &mut Self, certificates: C)
       where C: Into<Vec<Certificate, Global>>;
    fn root_certificates(builder: &Self) -> &[Certificate];
}
Expand description

Security-sensitive configuration for Builder.

Required Methods§

fn set_root_certificates<C>(builder: &mut Self, certificates: C)where C: Into<Vec<Certificate, Global>>,

Set Certificates to be added into the root certificate store for connecting to a server. This is added additionally to the Store root certificates and does not replace them.

See Builder::set_store.

Default

No additional Certificates.

Security

Managing your own root certificate store can make sense if a private CA is used. Otherwise use Endpoint::connect_pinned.

Examples
use fabruic::{dangerous, Builder, Store};

let mut builder = Builder::new();
builder.set_store(Store::Empty);
// CA certificate has to be imported from somewhere else
dangerous::Builder::set_root_certificates(&mut builder, [ca_certificate]);

fn root_certificates(builder: &Self) -> &[Certificate]

Returns Certificates set to be added into the root certificate store.

See set_root_certificates.

Examples
use fabruic::{dangerous, Builder, Store};

let mut builder = Builder::new();
builder.set_store(Store::Empty);
// CA certificate has to be imported from somewhere else
dangerous::Builder::set_root_certificates(&mut builder, [ca_certificate.clone()]);
assert_eq!(dangerous::Builder::root_certificates(&builder), [
	ca_certificate
]);

Implementors§