$keyfile ]); $result = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); // save the cert $json = @json_decode($result,true); if (empty($json['bundle'])) { $strError = _('Server was unable to provision SSL certificate'); if (!empty($json['error'])) { $strError .= ' - '.$json['error']; } response_complete(406, '{"error":"'.$strError.'"}'); } file_put_contents("{$certPath}.new", $json['bundle']); rename("{$certPath}.new", "$certPath"); response_complete($httpcode, $result, _('LE Cert Provisioned successfully')); ?>