Documentation
¶
Overview ¶
Package tlscert gives serve a TLS certificate when it binds beyond loopback: the operator's own (api.tls_cert and api.tls_key), or one it generates once, self-signed, and keeps in the state directory, so its fingerprint stays the same from one start to the next and a client can pin it.
Index ¶
Constants ¶
const ( CertFile = "tls-cert.pem" KeyFile = "tls-key.pem" )
The generated pair, in the state directory.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Config *tls.Config
// Fingerprint is the SHA-256 of the leaf certificate's DER, as hex pairs
// separated by colons: what a browser shows and what curl --pinnedpubkey
// is not (that one hashes the public key; see PublicKeyPin).
Fingerprint string
// PublicKeyPin is base64 SHA-256 of the leaf's public key, for curl's
// --pinnedpubkey "sha256//<pin>".
PublicKeyPin string
// Generated is set when the certificate is the tool's own self-signed one,
// and New when it was made on this start.
Generated, New bool
// CertPath is the file it came from.
CertPath string
}
Result is the certificate serve presents.