summaryrefslogtreecommitdiffstats
path: root/etc/inc/captiveportal.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r--etc/inc/captiveportal.inc17
1 files changed, 10 insertions, 7 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 653139a..ba9d7e4 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -454,16 +454,19 @@ function captiveportal_init_webgui_zone($cpcfg) {
$use_fastcgi = true;
if (isset($cpcfg['httpslogin'])) {
- $cert = base64_decode($cpcfg['certificate']);
- if (isset($cpcfg['cacertificate']))
- $cacert = base64_decode($cpcfg['cacertificate']);
- else
- $cacert = "";
- $key = base64_decode($cpcfg['private-key']);
+ $cert = lookup_cert($cpcfg['certref']);
+ $cert_crt = base64_decode($cert['crt']);
+ $cert_prv = base64_decode($cert['prv']);
+ if (isset($cpcfg['caref'])) {
+ $ca = lookup_ca($cpcfg['caref']);
+ $ca_crt = base64_decode($ca['crt']);
+ }
+ else
+ $ca_crt = "";
/* generate lighttpd configuration */
$listenporthttps = $cpcfg['listenporthttps'] ? $cpcfg['listenporthttps'] : ($cpcfg['zoneid'] + 1);
system_generate_lighty_config("{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf",
- $cert, $key, $cacert, "lighty-{$cpzone}-CaptivePortal-SSL.pid", $listenporthttps, "/usr/local/captiveportal",
+ $cert_crt, $cert_prv, $ca_crt, "lighty-{$cpzone}-CaptivePortal-SSL.pid", $listenporthttps, "/usr/local/captiveportal",
"cert-portal.pem", "ca-portal.pem", "1", $use_fastcgi, $cpzone);
}
OpenPOWER on IntegriCloud