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, ]; /** 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']);