I'm using kriswallsmith/Buzz browser inside my custom service Skebby
. Here is config.yml
, please note the call to setVerifyPeer(false)
to disable SSL certificate verification:
# cURL client
buzz.client.curl:
class: Buzz\Client\Curl
public: false
calls:
- [setVerifyPeer, [false]]
# Buzz browser configured to use cURL client
buzz.browser:
class: Buzz\Browser
arguments: ['@buzz.client.curl']
While Skebby
itself is annotated with schmittjoh/JMSDiExtraBundle:
/** @Service("skebby") */
Class Skebby
{
/**
* @InjectParams({
* "browser" = @Inject("buzz.browser"),
* "translator" = @Inject("translator")
* })
*
* @param \Buzz\Browser $browser
* @param \Symfony\Bundle\FrameworkBundle\Translation\Translator $translator
*/
public function __construct(Browser $browser, Translator $translator)
{
$this->browser = $browser;
$this->translator = $translator;
}
public function getCredit()
{
var_dump($this->browser->getClient());
die();
}
}
Unfortunately the call (inside a controller) $this->get('skebby')->getCredit()
shows that something wrong happened with the service container:
object(Buzz\Client\Curl)[4905]
private 'lastCurl' => null
protected 'options' =>
array (size=0)
empty
protected 'ignoreErrors' => boolean true
protected 'maxRedirects' => int 5
protected 'timeout' => int 5
protected 'verifyPeer' => boolean true
That is verifyPeer
is still true
, as the call setVerifyPeer(false)
never happened. Is there something wrong with my configuration?
Useful links:
AbstractClient.php
the abstract client classAbstractCurl.php
parent class for cURL client, extendingAbstractClient
Curl.php
the class itself, extendingAbstractCurl