module

LocalSend::Protocol::TLS

TLS for LocalSend's self-signed certificates.

LocalSend has no CA, so certificate-chain validation is disabled. Connections compare the presented SHA-256 fingerprint with the announcement instead.

Constants

Log = LocalSend::Log.for("tls")

Class methods

client_context(identity : Identity) : OpenSSL::SSL::Context::Client
Source
connect(identity : Identity, host : String, port : Int32, protocol : String, expect_fingerprint : String | Nil, timeout : Time::Span) : HTTP::Client

Opens an HTTP connection and verifies the expected TLS fingerprint before sending data.

Build the socket manually because HTTP::Client's TLS constructor does not expose it for fingerprint verification.

Source
fingerprint_of(socket : OpenSSL::SSL::Socket) : String | Nil
Source
matches?(presented : String | Nil, announced : String) : Bool

Checks the presented certificate against the announced fingerprint.

Source
server_context(identity : Identity) : OpenSSL::SSL::Context::Server
Source