Certificate for VestaCP Panel Server -> server configure -> Vesta SSL Bug ?!
-
- Posts: 2
- Joined: Sun Mar 12, 2017 3:54 pm
Certificate for VestaCP Panel Server -> server configure -> Vesta SSL Bug ?!
Hi, sorry if I post in wrong section !
I think I found a bug.
Certificate for VestaCP Panel Server -> server configure -> Vesta SSL
In here are 2 boxes: SSL Certificate and SSL Key.
There is same information in both boxes. I think he reads same file, or the POST information colect same info for both boxes.
I have a look inside:
right here:
but the code seems to be fine. Any idea ?
I think I found a bug.
Certificate for VestaCP Panel Server -> server configure -> Vesta SSL
In here are 2 boxes: SSL Certificate and SSL Key.
There is same information in both boxes. I think he reads same file, or the POST information colect same info for both boxes.
I have a look inside:
Code: Select all
/usr/local/vesta/web/edit/server/index.php
Code: Select all
// Update SSL certificate
if ((!empty($_POST['v_ssl_crt'])) && (empty($_SESSION['error_msg']))) {
if (($v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ($v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key']))) {
exec ('mktemp -d', $mktemp_output, $return_var);
$tmpdir = $mktemp_output[0];
// Certificate
if (!empty($_POST['v_ssl_crt'])) {
$fp = fopen($tmpdir."/certificate.crt", 'w');
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
fwrite($fp, "\n");
fclose($fp);
}
// Key
if (!empty($_POST['v_ssl_key'])) {
$fp = fopen($tmpdir."/certificate.key", 'w');
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
fwrite($fp, "\n");
fclose($fp);
}
exec (VESTA_CMD."v-change-sys-vesta-ssl ".$tmpdir, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
// List ssl certificate info
exec (VESTA_CMD."v-list-sys-vesta-ssl json", $output, $return_var);
$ssl_str = json_decode(implode('', $output), true);
unset($output);
$v_ssl_crt = $ssl_str['VESTA']['CRT'];
$v_ssl_key = $ssl_str['VESTA']['KEY'];
$v_ssl_ca = $ssl_str['VESTA']['CA'];
$v_ssl_subject = $ssl_str['VESTA']['SUBJECT'];
$v_ssl_aliases = $ssl_str['VESTA']['ALIASES'];
$v_ssl_not_before = $ssl_str['VESTA']['NOT_BEFORE'];
$v_ssl_not_after = $ssl_str['VESTA']['NOT_AFTER'];
$v_ssl_signature = $ssl_str['VESTA']['SIGNATURE'];
$v_ssl_pub_key = $ssl_str['VESTA']['PUB_KEY'];
$v_ssl_issuer = $ssl_str['VESTA']['ISSUER'];
}
}