Skip to content

Commit e79d958

Browse files
chadhutchinsPhil Sturgeon
authored andcommitted
Added ssl support
1 parent 9a10085 commit e79d958

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libraries/Curl.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,21 @@ public function proxy_login($username = '', $password = '')
199199
return $this;
200200
}
201201

202+
public function ssl( $verify_peer = TRUE, $verify_host = 2, $path_to_cert = NULL) {
203+
if ($verify_peer)
204+
{
205+
$this->option(CURLOPT_SSL_VERIFYPEER, TRUE);
206+
$this->option(CURLOPT_SSL_VERIFYHOST, $verify_host);
207+
$this->option(CURLOPT_CAINFO, $path_to_cert);
208+
}
209+
else
210+
{
211+
$this->option(CURLOPT_SSL_VERIFYPEER, FALSE);
212+
}
213+
return $this;
214+
}
215+
216+
202217
public function options($options = array())
203218
{
204219
// Merge options in with the rest - done as array_merge() does not overwrite numeric keys

0 commit comments

Comments
 (0)