Skip to content

Instantly share code, notes, and snippets.

@enygma
Created October 17, 2012 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enygma/3906604 to your computer and use it in GitHub Desktop.
Save enygma/3906604 to your computer and use it in GitHub Desktop.
Change in Guzzle options for CURL and self-signed certs
<?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