Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion Debian/Ubuntu
  • Search

Certificate for VestaCP Panel Server -> server configure -> Vesta SSL Bug ?!

Debian/Ubuntu related topics
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
tilicar43v3r
Posts: 2
Joined: Sun Mar 12, 2017 3:54 pm

Certificate for VestaCP Panel Server -> server configure -> Vesta SSL Bug ?!
  • Quote

Post by tilicar43v3r » Sun Mar 12, 2017 4:03 pm

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:

Code: Select all

 /usr/local/vesta/web/edit/server/index.php
right here:

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'];
        }
    }
but the code seems to be fine. Any idea ?
Top


Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Debian/Ubuntu”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password