pub trait Builder {
// Required methods
fn set_root_certificates<C>(builder: &mut Self, certificates: C)
where C: Into<Vec<Certificate>>;
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)
fn set_root_certificates<C>(builder: &mut Self, certificates: C)
Set Certificate
s to be added into the root certificate store for
connect
ing to a server. This is added
additionally to the Store
root certificates and does not replace
them.
See Builder::set_store
.
Default
No additional Certificate
s.
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]
fn root_certificates(builder: &Self) -> &[Certificate]
Returns Certificate
s set to be added into the root certificate
store.
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
]);
Object Safety§
This trait is not object safe.