include the Zebra_cURL library
require 'path/to/Zebra_cURL';
instantiate the class
$curl = new Zebra_cURL();
instruct the library to verify peer's SSL certificate
(ignored if request is not made through HTTPS)
$curl->ssl(true);
fetch a page
$curl->get('https://www.somewebsite.com/', create_function('$result', 'print_r("
"); print_r($result);'));
public ssl ( boolean $verify_peer = true, integer $verify_host = 2, mixed $file = false, mixed $path = false ) : void | ||
$verify_peer | boolean | (Optional) Should the peer's certificate be verified by cURL? Default is TRUE. This option can also be set using the {@link option} method and setting CURLOPT_SSL_VERIFYPEER option to the desired value. @param integer $verify_host (Optional) Specifies whether or not to check the existence of a common name in the SSL peer certificate and that it matches with the provided hostname. - 1 to check the existence of a common name in the SSL peer certificate; - 2 to check the existence of a common name and also verify that it matches the hostname provided; in production environments the value of this option should be kept at 2; Default is 2 Support for value 1 removed in cURL 7.28.1 This option can also be set using the {@link option} method and setting CURLOPT_SSL_VERIFYHOST option to the desired value. @param mixed $file (Optional) An absolute path to a file holding one or more certificates to verify the peer with. This only makes sense if CURLOPT_SSL_VERIFYPEER is set to TRUE. Default is FALSE. This option can also be set using the {@link option} method and setting CURLOPT_CAINFO option to the desired value. @param mixed $path (Optional) An absolute path to a directory that holds multiple CA certificates. This only makes sense if CURLOPT_SSL_VERIFYPEER is set to TRUE. Default is FALSE. This option can also be set using the {@link option} method and setting CURLOPT_CAPATH option to the desired value. @return void |
$verify_host | integer | |
$file | mixed | |
$path | mixed | |
return | void |