Skip to content

Commit 6525037

Browse files
authored
fix(cli): use retryable client for ACME server calls (#2368)
1 parent 0bbf5ab commit 6525037

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/setup.go

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/go-acme/lego/v4/lego"
1414
"github.com/go-acme/lego/v4/log"
1515
"github.com/go-acme/lego/v4/registration"
16+
"github.com/hashicorp/go-retryablehttp"
1617
"github.com/urfave/cli/v2"
1718
)
1819

@@ -65,6 +66,12 @@ func newClient(ctx *cli.Context, acc registration.User, keyType certcrypto.KeyTy
6566
}
6667
}
6768

69+
retryClient := retryablehttp.NewClient()
70+
retryClient.RetryMax = 5
71+
retryClient.HTTPClient = config.HTTPClient
72+
73+
config.HTTPClient = retryClient.StandardClient()
74+
6875
client, err := lego.NewClient(config)
6976
if err != nil {
7077
log.Fatalf("Could not create client: %v", err)

0 commit comments

Comments
 (0)