pub struct Trust { /* private fields */ }Expand description
Which servers this client is willing to believe.
Implementations§
Source§impl Trust
impl Trust
Sourcepub fn plaintext() -> Self
pub fn plaintext() -> Self
No certificate is expected. For http:// and ws:// servers.
A TLS server offered to this is refused, whatever it presents.
Sourcepub fn boat_ca(pem: &[u8]) -> Result<Self, ClientError>
pub fn boat_ca(pem: &[u8]) -> Result<Self, ClientError>
Trust only servers whose certificate the boat’s own authority signed.
pem is the authority’s certificate – boat-ca.crt, the public
half. Several may be concatenated, which is what makes replacing an
authority possible without taking every device out of service on the
same afternoon: carry both for one season, then drop the old one.
§Errors
If the PEM holds no certificate at all. A file that was truncated, or a private key handed over by mistake, has to fail here rather than produce a client that trusts nothing and blames the network.
Sourcepub fn is_plaintext(&self) -> bool
pub fn is_plaintext(&self) -> bool
Whether anything is trusted, i.e. whether TLS can succeed at all.