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.
This commit is contained in:
@@ -495,8 +495,8 @@ class Client
|
|||||||
private function curl($method, $url, $data = null)
|
private function curl($method, $url, $data = null)
|
||||||
{
|
{
|
||||||
$headers = array(
|
$headers = array(
|
||||||
'Accept: application/json',
|
'Accept: application/jose+json',
|
||||||
'Content-Type: application/json'
|
'Content-Type: application/jose+json'
|
||||||
);
|
);
|
||||||
$handle = curl_init();
|
$handle = curl_init();
|
||||||
curl_setopt($handle, CURLOPT_URL, preg_match('~^http~', $url) ? $url : $this->base . $url);
|
curl_setopt($handle, CURLOPT_URL, preg_match('~^http~', $url) ? $url : $this->base . $url);
|
||||||
@@ -550,7 +550,7 @@ class Client
|
|||||||
return trim($matches[1]);
|
return trim($matches[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->curl('GET', '/directory');
|
$this->curl('GET', '/acme/new-nonce');
|
||||||
return $this->getLastNonce();
|
return $this->getLastNonce();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user