Created
October 17, 2012 16:37
-
-
Save enygma/3906604 to your computer and use it in GitHub Desktop.
Change in Guzzle options for CURL and self-signed certs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* When using Guzzle with self-signed certs, something recently changed that makes the | |
* previous manual config no longer work...see below | |
*/ | |
// this no longer works | |
$init = array( | |
'curl.CURLOPT_SSL_VERIFYHOST' => false, | |
'curl.CURLOPT_SSL_VERIFYPEER' => false, | |
'curl.CURLOPT_HTTPAUTH' => CURLAUTH_BASIC, | |
'curl.CURLOPT_USERPWD' => | |
$this->getConfig('application_id') . | |
':' . $this->getConfig('application_password') | |
); | |
// this does... | |
$init = array( | |
'curl.options' => array( | |
'CURLOPT_SSL_VERIFYHOST' => false, | |
'CURLOPT_SSL_VERIFYPEER' => false, | |
'CURLOPT_HTTPAUTH' => CURLAUTH_BASIC, | |
'CURLOPT_USERPWD' => | |
$this->getConfig('application_id') . | |
':' . $this->getConfig('application_password'), | |
), | |
'ssl.certificate_authority' => false | |
); | |
// then we make the client | |
$this->_client = new \Guzzle\Service\Client( | |
$this->getConfig('host'), | |
$init | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment