summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-05-11 09:58:47 +0200
committerAleksander Machniak <machniak@kolabsys.com>2012-05-11 09:58:47 +0200
commit6beb449f9b160725f3b7c2b36c54c331bc73bb3f (patch)
treee512cc8a45c69ecaaf2cae136b93a26bc1c4dcdd
parent8eb656d4e0e534bfc71a2613c18f5b4d8d4d5612 (diff)
downloadwebadmin-6beb449f9b160725f3b7c2b36c54c331bc73bb3f.tar.gz
Support SSL connection configuration of HTTP_Request2 via kolab.conf (#751)
-rw-r--r--lib/kolab_client_api.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/kolab_client_api.php b/lib/kolab_client_api.php
index b8d101a..4159a84 100644
--- a/lib/kolab_client_api.php
+++ b/lib/kolab_client_api.php
@@ -60,6 +60,28 @@ class kolab_client_api
public function init()
{
$this->request = new HTTP_Request2();
+
+ // Configure connection options
+ $config = Conf::get_instance();
+ $options = array(
+ 'ssl_verify_peer',
+ 'ssl_verify_host',
+ 'ssl_cafile',
+ 'ssl_capath',
+ 'ssl_local_cert',
+ 'ssl_passphrase',
+ );
+
+ foreach ($options as $optname) {
+ if (($optvalue = $config->get('kolab_wap', $optname)) !== null) {
+ try {
+ $this->request->setConfig($optname, $optvalue);
+ }
+ catch (Exception $e) {
+ write_log('errors', $e->getMessage());
+ }
+ }
+ }
}
/**