From c62083037fb019a12babcf7d406f6dc5b6d8341e Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 2 Dec 2016 09:34:39 +0100 Subject: [PATCH 1/2] Add support to sslcafile and sslcapath to cURL adapter --- src/Client/Adapter/Curl.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Client/Adapter/Curl.php b/src/Client/Adapter/Curl.php index 552b781890..37312c9ff4 100644 --- a/src/Client/Adapter/Curl.php +++ b/src/Client/Adapter/Curl.php @@ -209,6 +209,13 @@ public function connect($host, $port = 80, $secure = false) } } + if (isset($this->config['sslcafile']) && $this->config['sslcafile']) { + curl_setopt($this->curl, CURLOPT_CAINFO, $this->config['sslcafile']); + } + if (isset($this->config['sslcapath']) && $this->config['sslcapath']) { + curl_setopt($this->curl, CURLOPT_CAPATH, $this->config['sslcapath']); + } + if (isset($this->config['maxredirects'])) { // Set Max redirects curl_setopt($this->curl, CURLOPT_MAXREDIRS, $this->config['maxredirects']); From 51949998ae5c25a4949f11ff59cda47ea4bc97a6 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 2 Dec 2016 10:21:42 +0100 Subject: [PATCH 2/2] Add sslcafile and sslcapath to default options So that people may easily see that they exist --- src/Client.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 8549db624b..ce4855fde6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -110,7 +110,9 @@ class Client implements Stdlib\DispatchableInterface 'outputstream' => false, 'encodecookies' => true, 'argseparator' => null, - 'rfc3986strict' => false + 'rfc3986strict' => false, + 'sslcafile' => null, + 'sslcapath' => null, ]; /**