set ssl variables also when session not yet exists
This commit is contained in:
parent
d0f6befa7e
commit
7654fdfd3c
|
@ -44,14 +44,19 @@ include_once '2factor.inc';
|
|||
* Sets the environment variables for custom SSL CA certificates.
|
||||
*/
|
||||
function setSSLCaCert() {
|
||||
// set SSL certificate if set
|
||||
$config = null;
|
||||
if (isset($_SESSION['cfgMain'])) {
|
||||
$sslCaPath = $_SESSION['cfgMain']->getSSLCaCertPath();
|
||||
$config = $_SESSION['cfgMain'];
|
||||
}
|
||||
else {
|
||||
$config = new LAMCfgMain();
|
||||
}
|
||||
// set SSL certificate if set
|
||||
$sslCaPath = $config->getSSLCaCertPath();
|
||||
if ($sslCaPath != null) {
|
||||
putenv('LDAPTLS_CACERT=' . $sslCaPath);
|
||||
putenv('TLS_CACERT=' . $sslCaPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue