set ssl variables also when session not yet exists

This commit is contained in:
Roland Gruber 2017-11-19 10:31:26 +01:00
parent d0f6befa7e
commit 7654fdfd3c
1 changed files with 11 additions and 6 deletions

View File

@ -44,13 +44,18 @@ include_once '2factor.inc';
* Sets the environment variables for custom SSL CA certificates. * Sets the environment variables for custom SSL CA certificates.
*/ */
function setSSLCaCert() { function setSSLCaCert() {
// set SSL certificate if set $config = null;
if (isset($_SESSION['cfgMain'])) { if (isset($_SESSION['cfgMain'])) {
$sslCaPath = $_SESSION['cfgMain']->getSSLCaCertPath(); $config = $_SESSION['cfgMain'];
if ($sslCaPath != null) { }
putenv('LDAPTLS_CACERT=' . $sslCaPath); else {
putenv('TLS_CACERT=' . $sslCaPath); $config = new LAMCfgMain();
} }
// set SSL certificate if set
$sslCaPath = $config->getSSLCaCertPath();
if ($sslCaPath != null) {
putenv('LDAPTLS_CACERT=' . $sslCaPath);
putenv('TLS_CACERT=' . $sslCaPath);
} }
} }