mirror of
https://github.com/go-acme/lego.git
synced 2024-12-22 07:12:22 +02:00
fix(cli): use retryable client for ACME server calls (#2368)
This commit is contained in:
parent
0bbf5ab59c
commit
65250372ee
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/go-acme/lego/v4/lego"
|
"github.com/go-acme/lego/v4/lego"
|
||||||
"github.com/go-acme/lego/v4/log"
|
"github.com/go-acme/lego/v4/log"
|
||||||
"github.com/go-acme/lego/v4/registration"
|
"github.com/go-acme/lego/v4/registration"
|
||||||
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"github.com/urfave/cli/v2"
|
"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)
|
client, err := lego.NewClient(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not create client: %v", err)
|
log.Fatalf("Could not create client: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user