• Matthew Holt's avatar
    Major refactor of all HTTPS/TLS/ACME code · 11103bd8
    Matthew Holt authored
    Biggest change is no longer using standard library's tls.Config.getCertificate function to get a certificate during TLS handshake. Implemented our own cache which can be changed dynamically at runtime, even during TLS handshakes. As such, restarts are no longer required after certificate renewals or OCSP updates.
    
    We also allow loading multiple certificates and keys per host, even by specifying a directory (tls got a new 'load' command for that).
    
    Renamed the letsencrypt package to https in a gradual effort to become more generic; and https is more fitting for what the package does now.
    
    There are still some known bugs, e.g. reloading where a new certificate is required but port 80 isn't currently listening, will cause the challenge to fail. There's still plenty of cleanup to do and tests to write. It is especially confusing right now how we enable "on-demand" TLS during setup and keep track of that. But this change should basically work so far.
    11103bd8
server.go 14.2 KB