about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/server/tls.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/server/tls.go b/internal/server/tls.go
index f51d36a..40fddac 100644
--- a/internal/server/tls.go
+++ b/internal/server/tls.go
@@ -7,6 +7,7 @@ import (
 	"net/http"
 	"slices"
 	"strconv"
+	"strings"
 
 	"go.alanpearce.eu/x/listenfd"
 
@@ -39,9 +40,10 @@ func (s *Server) serveTLS() (err error) {
 	cfg := certmagic.NewDefault()
 
 	acme := &certmagic.DefaultACME
+	acme.Logger = certmagic.Default.Logger
 	acme.Agreed = true
 	acme.Email = s.config.Email
-	acme.ListenHost = s.runtimeConfig.ListenAddress
+	acme.ListenHost = strings.Trim(s.runtimeConfig.ListenAddress, "[]")
 
 	if s.runtimeConfig.Development {
 		ca := s.runtimeConfig.ACMECA
@@ -157,6 +159,7 @@ func (s *Server) serveTLS() (err error) {
 		"https_port",
 		s.runtimeConfig.TLSPort,
 	)
+	cfg.Issuers = []certmagic.Issuer{certmagic.NewACMEIssuer(cfg, *acme)}
 	err = cfg.ManageAsync(context.TODO(), certificateDomains)
 	if err != nil {
 		return errors.WithMessage(err, "could not enable TLS")