From 001f10f74e0d7b8c37f152129e4e0916ec329d8b Mon Sep 17 00:00:00 2001 From: Daniel Reichelt Date: Mon, 16 May 2016 16:28:23 +0200 Subject: [PATCH] LE: catch error due to rate-limited account registration and fix bad english in log message --- lib/classes/ssl/class.lescript.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/classes/ssl/class.lescript.php b/lib/classes/ssl/class.lescript.php index 9a2b2b94..4ea258b0 100644 --- a/lib/classes/ssl/class.lescript.php +++ b/lib/classes/ssl/class.lescript.php @@ -73,6 +73,12 @@ class lescript )); } $this->accountKey = $keys['private']; + + $response = $this->postNewReg(); + if ($this->client->getLastCode() != 201) { + throw new \RuntimeException("Account not initialized, probably due to rate limiting. Whole response: " . $response); + } + $this->postNewReg(); $this->log('New account certificate registered'); } else { @@ -84,7 +90,7 @@ class lescript public function signDomains(array $domains, $domainkey = null, $csr = null) { if (! $this->accountKey) { - throw new \RuntimeException("Account not initiated"); + throw new \RuntimeException("Account not initialized"); } $this->log('Starting certificate generation process for domains');