Documentation
¶
Overview ¶
Package tlscert generates a self-signed TLS certificate + key so the server can serve HTTPS without external tooling (the `dockercmd --make-certs` action). For public hosts, use a real CA / ACME instead.
Index ¶
Constants ¶
const Validity = 397 * 24 * time.Hour
Validity is how long a generated self-signed certificate is valid for. It is kept under the 398-day ceiling that Apple/Chrome enforce for TLS server certs (they reject longer-lived leaves even when the cert is manually trusted).
Variables ¶
This section is empty.
Functions ¶
func GenerateSelfSigned ¶
GenerateSelfSigned returns PEM-encoded certificate and private key for an ECDSA P-256 self-signed certificate covering the given hosts (DNS names and/or IP addresses), plus localhost / 127.0.0.1 / ::1.
func WriteCertPair ¶
WriteCertPair writes the cert (0644) and key (0600) into dir (created 0700 if needed) and returns their paths. The private key is never group/world-readable even if the file already existed.
Types ¶
This section is empty.