output error in case of a server-error from LE, fixes #1609
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -102,6 +102,13 @@ class lescript
|
||||
array("resource" => "new-authz", "identifier" => array("type" => "dns", "value" => $domain))
|
||||
);
|
||||
|
||||
// if response is not an array but a string, it's most likely a server-error, e.g.
|
||||
// <HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>An error occurred while processing your request.
|
||||
// <p>Reference #179.d8be1402.1458059103.3613c4db</BODY></HTML>
|
||||
if (!is_array($response)) {
|
||||
throw new RuntimeException("Invalid response from LE for domain $domain. Whole response: ".$response);
|
||||
}
|
||||
|
||||
if (!array_key_exists('challenges', $response)) {
|
||||
throw new RuntimeException("No challenges received for $domain. Whole response: ".json_encode($response));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user