Skip to content

Commit

Permalink
Add cookie jar to ACME HTTP client
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed May 7, 2024
1 parent c0c6186 commit 3d513c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions acmeissuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"net"
"net/http"
"net/http/cookiejar"
"net/url"
"sort"
"strings"
Expand All @@ -31,6 +32,7 @@ import (
"github.com/mholt/acmez/v2"
"github.com/mholt/acmez/v2/acme"
"go.uber.org/zap"
"golang.org/x/net/publicsuffix"
)

// ACMEIssuer gets certificates using ACME. It implements the PreChecker,
Expand Down Expand Up @@ -273,9 +275,11 @@ func NewACMEIssuer(cfg *Config, template ACMEIssuer) *ACMEIssuer {
RootCAs: template.TrustedRoots,
}
}
jar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List}) // lol it never returns an error (as of May 2024)
template.httpClient = &http.Client{
Transport: transport,
Timeout: HTTPTimeout,
Jar: jar,
}

return &template
Expand Down

0 comments on commit 3d513c9

Please sign in to comment.