diff --git a/cli.go b/cli.go index 997f974e..438557fe 100644 --- a/cli.go +++ b/cli.go @@ -146,6 +146,10 @@ func main() { Name: "dns", Usage: "Solve a DNS challenge using the specified provider. Disables all other challenges. Run 'lego dnshelp' for help on usage.", }, + cli.IntFlag{ + Name: "http-timeout", + Usage: "Set the HTTP timeout value to a specific value in seconds. The default is 10 seconds.", + }, } err = app.Run(os.Args) diff --git a/cli_handlers.go b/cli_handlers.go index 5585bcfb..6a2fe56e 100644 --- a/cli_handlers.go +++ b/cli_handlers.go @@ -32,6 +32,11 @@ func checkFolder(path string) error { } func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) { + + if c.GlobalIsSet("http-timeout") { + acme.HTTPTimeout = time.Duration(c.GlobalInt("http-timeout")) * time.Second + } + err := checkFolder(c.GlobalString("path")) if err != nil { logger().Fatalf("Could not check/create path: %s", err.Error())