Skip to content

Commit 997990a

Browse files
author
Serghey Rodin
committed
Update SSL info
1 parent 7b0a2e9 commit 997990a

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

web/edit/web/index.php

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,20 @@
308308
unset($output);
309309
$restart_web = 'yes';
310310
$restart_proxy = 'yes';
311-
$v_ssl_crt = $_POST['v_ssl_crt'];
312-
$v_ssl_key = $_POST['v_ssl_key'];
313-
$v_ssl_ca = $_POST['v_ssl_ca'];
311+
312+
exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var);
313+
$ssl_str = json_decode(implode('', $output), true);
314+
unset($output);
315+
$v_ssl_crt = $ssl_str[$v_domain]['CRT'];
316+
$v_ssl_key = $ssl_str[$v_domain]['KEY'];
317+
$v_ssl_ca = $ssl_str[$v_domain]['CA'];
318+
$v_ssl_subject = $ssl_str[$v_domain]['SUBJECT'];
319+
$v_ssl_aliases = $ssl_str[$v_domain]['ALIASES'];
320+
$v_ssl_not_before = $ssl_str[$v_domain]['NOT_BEFORE'];
321+
$v_ssl_not_after = $ssl_str[$v_domain]['NOT_AFTER'];
322+
$v_ssl_signature = $ssl_str[$v_domain]['SIGNATURE'];
323+
$v_ssl_pub_key = $ssl_str[$v_domain]['PUB_KEY'];
324+
$v_ssl_issuer = $ssl_str[$v_domain]['ISSUER'];
314325

315326
// Cleanup certificate tempfiles
316327
if (!empty($_POST['v_ssl_crt'])) {
@@ -374,10 +385,20 @@
374385
$v_ssl = 'yes';
375386
$restart_web = 'yes';
376387
$restart_proxy = 'yes';
377-
$v_ssl_crt = $_POST['v_ssl_crt'];
378-
$v_ssl_key = $_POST['v_ssl_key'];
379-
$v_ssl_ca = $_POST['v_ssl_ca'];
380-
$v_ssl_home = $_POST['v_ssl_home'];
388+
389+
exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var);
390+
$ssl_str = json_decode(implode('', $output), true);
391+
unset($output);
392+
$v_ssl_crt = $ssl_str[$v_domain]['CRT'];
393+
$v_ssl_key = $ssl_str[$v_domain]['KEY'];
394+
$v_ssl_ca = $ssl_str[$v_domain]['CA'];
395+
$v_ssl_subject = $ssl_str[$v_domain]['SUBJECT'];
396+
$v_ssl_aliases = $ssl_str[$v_domain]['ALIASES'];
397+
$v_ssl_not_before = $ssl_str[$v_domain]['NOT_BEFORE'];
398+
$v_ssl_not_after = $ssl_str[$v_domain]['NOT_AFTER'];
399+
$v_ssl_signature = $ssl_str[$v_domain]['SIGNATURE'];
400+
$v_ssl_pub_key = $ssl_str[$v_domain]['PUB_KEY'];
401+
$v_ssl_issuer = $ssl_str[$v_domain]['ISSUER'];
381402

382403
// Cleanup certificate tempfiles
383404
if (!empty($_POST['v_ssl_crt'])) {

0 commit comments

Comments
 (0)