From 94c4d524764534856493651bccb4bb290a0a861a Mon Sep 17 00:00:00 2001 From: markuspetermann Date: Sat, 15 Sep 2018 12:41:27 +0200 Subject: [PATCH] Fixed class.lescript_v2.php to work with ACMEv2 As GET /document never returns any Reply-Nonce Header, getLastNonce() caused an infinite loop. The Content-Type for v2 must be application/jose+json. --- lib/classes/ssl/class.lescript_v2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/classes/ssl/class.lescript_v2.php b/lib/classes/ssl/class.lescript_v2.php index 448222eb..4469546b 100644 --- a/lib/classes/ssl/class.lescript_v2.php +++ b/lib/classes/ssl/class.lescript_v2.php @@ -495,8 +495,8 @@ class Client private function curl($method, $url, $data = null) { $headers = array( - 'Accept: application/json', - 'Content-Type: application/json' + 'Accept: application/jose+json', + 'Content-Type: application/jose+json' ); $handle = curl_init(); curl_setopt($handle, CURLOPT_URL, preg_match('~^http~', $url) ? $url : $this->base . $url); @@ -550,7 +550,7 @@ class Client return trim($matches[1]); } - $this->curl('GET', '/directory'); + $this->curl('GET', '/acme/new-nonce'); return $this->getLastNonce(); }