diff --git a/libs/tls/README.md b/libs/tls/README.md index 634657a09..186bfbb53 100644 --- a/libs/tls/README.md +++ b/libs/tls/README.md @@ -8,13 +8,13 @@ The tls handshake involves the host offering the client a Certificate signed for It does not seem in keeping with the Precursor/Xous idea to ask users to trust any such list of Root CA Certificates. -This tls library enables the user to obtain and save trusted CA certificates to the PDDB as a personalised set of trusted Root CA certificates on which to establish a tls connection. This can be as simple for the user as responding to a modal, when making a first connection to an as yet un-trusted host. Just a couple of clicks. The developer need only call `Tls::check_trust()`. +This tls library enables the user to obtain and save trusted CA certificates to the PDDB as a personalised set of trusted Root CA certificates on which to establish a tls connection. This can be as simple for the user as responding to a modal, when making a first connection to an as yet un-trusted host. Just a couple of clicks. The developer need only call `Tls::trust_modal()`. Note that hosts with self-signed Certificates may be probed and trusted (e.g. [chat.signal.org](https://chat.signal.org)) A small set of shellchat commands are included to enact the base functionality: -- `net tls probe ` will initiate a modified tls handshake with ``, obtain the certificate chain offered by ``, and immediately terminate the connection. A call to Tls::check_trust() will present the CA certificate chain in a modal to be individually selected and saved to PDDB if trusted. +- `net tls probe ` will initiate a modified tls handshake with ``, obtain the certificate chain offered by ``, and immediately terminate the connection. A call to Tls::trust_modal() will present the CA certificate chain in a modal to be individually selected and saved to PDDB if trusted. - `net tls test ` will attempt a normal tls handshake with `` based on the trusted Root CA certificates in the PDDB. If the connection is successful, then a simple `get` is emitted, the response accepted, and the connection closed. - `net tls mozilla` trusts and saves all Root CA's in the [webpki-roots crate](https://crates.io/crates/webpki-roots) - which contains Mozilla's root certificates. (requires `--feature rootCA`) - `net list` lists all trusted certificates in the PDDB diff --git a/libs/tls/src/lib.rs b/libs/tls/src/lib.rs index 614d5c1a7..9b47719ab 100644 --- a/libs/tls/src/lib.rs +++ b/libs/tls/src/lib.rs @@ -45,7 +45,7 @@ impl Tls { /// /// a count of trusted certificates /// - pub fn check_trust(&self, certificates: &[Certificate]) -> usize { + pub fn trust_modal(&self, certificates: &[Certificate]) -> usize { let xns = XousNames::new().unwrap(); let modals = Modals::new(&xns).unwrap(); @@ -319,7 +319,7 @@ impl Tls { } conn.send_close_notify(); match conn.peer_certificates() { - Some(certificates) => Ok(self.check_trust(certificates)), + Some(certificates) => Ok(self.trust_modal(certificates)), None => Ok(0), } }