diff --git a/cmd/setup.go b/cmd/setup.go index 5e878827..3fc05038 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -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" ) @@ -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)