I tried to install letsencrypt ssl via API and I’m getting Error code 10
which is: E_FORBIDEN Object cannot be accessed by this user
I’m I missing something here?
`function hestia_InstallSsl($params)
{
if ($params["server"] == 1) {
$postvars = array(
'hash' => $params["serveraccesshash"],
'returncode' => 'yes',
'cmd' => 'v-add-letsencrypt-domain',
'arg1' => $params["username"],
'arg2' => $params["domain"],
'arg3' => "'",
'arg4' => 'yes',
);
$postdata = http_build_query($postvars);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $params["serverhostname"] . ':' . $params["serverport"] . '/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$answer = curl_exec($curl);
}
logModuleCall('hestia', 'InstallSSL', 'https://' . $params["serverhostname"] . ':' . $params["serverport"] . '/api/' . $postdata, $answer);
if ($answer == 0) {
$result = "success";
} else {
$result = $answer;
}
return $result;
}`