Skip to content

Commit

Permalink
fix(cli): use retryable client for ACME server calls (#2368)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Dec 10, 2024
1 parent 0bbf5ab commit 6525037
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/go-acme/lego/v4/lego"
"github.com/go-acme/lego/v4/log"
"github.com/go-acme/lego/v4/registration"
"github.com/hashicorp/go-retryablehttp"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -65,6 +66,12 @@ func newClient(ctx *cli.Context, acc registration.User, keyType certcrypto.KeyTy
}
}

retryClient := retryablehttp.NewClient()
retryClient.RetryMax = 5
retryClient.HTTPClient = config.HTTPClient

config.HTTPClient = retryClient.StandardClient()

client, err := lego.NewClient(config)
if err != nil {
log.Fatalf("Could not create client: %v", err)
Expand Down

0 comments on commit 6525037

Please sign in to comment.