Expand description
Transport for the LocalSend protocol: a self-signed TLS identity, rustls streams, and the small slice of HTTP/1.1 the protocol needs. Every connection carries one request and is closed after the response.
Structs§
- Identity
- This device’s certificate and key. The fingerprint the protocol asks for is
the SHA-256 of the certificate (DER), as lowercase hex. The host stores the
two DER blobs (a Keychain item, or a file it protects) and hands them back
through
Identity::load; the crate never writes key material. - Reply
- Request
Enums§
Functions§
- accept_
tls - Wrap an accepted connection in TLS (server side).
- call
- Send one request on
wireand read the whole response.write_bodywrites exactlylengthbytes. - connect
- Connect to a peer. HTTPS peers are pinned to their announced fingerprint.
- connect_
within connectwith its own limit on how long the TCP connection may take.- prove_
key - Connect-back proof for a sender that presented no client certificate: open
our own TLS connection to
ip:portand require that the server there holds the private key of a certificate whose SHA-256 isfingerprint(the pinned handshake signature is genuinely verified, seePinVerifier). False for a malformed fingerprint, a refused connection, a wrong key or a timeout (3 s). - read_
body - Read a message body (Content-Length or chunked) and hand it to
sinkin pieces. More thanmaxbytes is an error. - read_
request - request_
json - One small request with an optional JSON body, on a fresh connection.
- server_
config - set_
client_ identity - set_
user_ agent - sha256_
hex - valid_
pin - Whether
fingerprintis a SHA-256 in hex, the only thing a send is pinned to. - write_
response