diff --git a/libraries/Curl.php b/libraries/Curl.php index c8bea6b..ea102f3 100644 --- a/libraries/Curl.php +++ b/libraries/Curl.php @@ -199,6 +199,21 @@ public function proxy_login($username = '', $password = '') return $this; } + public function ssl( $verify_peer = TRUE, $verify_host = 2, $path_to_cert = NULL) { + if ($verify_peer) + { + $this->option(CURLOPT_SSL_VERIFYPEER, TRUE); + $this->option(CURLOPT_SSL_VERIFYHOST, $verify_host); + $this->option(CURLOPT_CAINFO, $path_to_cert); + } + else + { + $this->option(CURLOPT_SSL_VERIFYPEER, FALSE); + } + return $this; + } + + public function options($options = array()) { // Merge options in with the rest - done as array_merge() does not overwrite numeric keys