Decode recently created cert and key. It fixes #3964. While here, fix logical condition to create a new cert if crt or key is not present

This commit is contained in:
Renato Botelho 2014-10-28 10:17:16 -02:00
parent 4721677dd7
commit 44c7d73c4a
1 changed files with 3 additions and 3 deletions

View File

@ -826,10 +826,10 @@ function system_webgui_start() {
if ($config['system']['webgui']['protocol'] == "https") {
// Ensure that we have a webConfigurator CERT
$cert =& lookup_cert($config['system']['webgui']['ssl-certref']);
if(!is_array($cert) && !$cert['crt'] && !$cert['prv']) {
if(!is_array($cert) || !$cert['crt'] || !$cert['prv']) {
$cert = system_webgui_create_certificate();
$crt = $cert['crt'];
$key = $cert['prv'];
$crt = base64_decode($cert['crt']);
$key = base64_decode($cert['prv']);
} else {
$crt = base64_decode($cert['crt']);
$key = base64_decode($cert['prv']);