mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
implement UDM_REST_INSECURE environment variable to UCS appliance with no valid cert yet
This commit is contained in:
parent
2dc457c007
commit
b960a24c32
@ -19,6 +19,9 @@ use EGroupware\Api;
|
||||
/**
|
||||
* Univention UDM REST Api
|
||||
*
|
||||
* Environment variable UDM_REST_INSECURE=<not-empty> can be set to (temporary) disable certificate validation for UDM REST calls.
|
||||
* Used by EGroupware UCS appliance, which does not yet have a final certificate during EGroupware installation.
|
||||
*
|
||||
* @todo Use just UDM instead of still calling ldap/parent
|
||||
*/
|
||||
class Udm
|
||||
@ -109,7 +112,8 @@ class Udm
|
||||
$curlOpts = [
|
||||
CURLOPT_URL => 'https://'.$this->host.($_path[0] !== '/' ? self::PREFIX : '').$_path,
|
||||
CURLOPT_USERPWD => $this->user.':'.$this->config['ldap_root_pw'],
|
||||
//CURLOPT_SSL_VERIFYHOST => 2, // 0: to disable certificate check
|
||||
CURLOPT_SSL_VERIFYHOST => empty($_SERVER['UDM_REST_INSECURE']) ? 2 : 0, // 0: to disable certificate check
|
||||
CURLOPT_SSL_VERIFYPEER => empty($_SERVER['UDM_REST_INSECURE']),
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Accept: application/json',
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user