-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to configure the guzzle client ? #18
Comments
How to configure the url from |
Figured it out, to use
|
Hum… why port 8000 ? I do not understand what you are trying to do… |
Just what my dev is currently on. But no reason why you could not do E.g.
|
This what I did, and then I got errors because guzzle was checking the server certificate. |
Oh I see. I will try to investigate later on. Otherwise hopefully someone else has the answer? |
According to Guzzle default code, it will check the Cert... protected function getDefaultOptions()
{
$settings = [
'allow_redirects' => true,
'exceptions' => true,
'decode_content' => true,
'verify' => __DIR__ . '/cacert.pem'
];
// Use the bundled cacert if it is a regular file, or set to true if
// using a phar file (because curL and the stream wrapper can't read
// cacerts from the phar stream wrapper). Favor the ini setting over
// the system's cacert.
if (substr(__FILE__, 0, 7) == 'phar://') {
$settings['verify'] = ini_get('openssl.cafile') ?: true;
}
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set
if ($proxy = getenv('HTTP_PROXY')) {
$settings['proxy']['http'] = $proxy;
}
if ($proxy = getenv('HTTPS_PROXY')) {
$settings['proxy']['https'] = $proxy;
}
return $settings;
} |
When the Guzzle Client is created in the Extension, you can pass it public function load(ContainerBuilder $container, array $config)
{
$this->loadClient($container, $config);
$this->loadContextInitializer($container, $config);
}
private function loadClient(ContainerBuilder $container, $config)
{
$definition = new Definition('GuzzleHttp\Client', array($config));
$container->setDefinition(self::CLIENT_ID, $definition);
} Hope that helps a bit |
@eddiejaoude : I saw that, but it doesn't help because |
Here is my work around (to set the
|
Note, I now use https://github.com/teaandcode/behat-guzzle-extension |
I'm testing an API that I just moved to
https
, and since I'm using a self-signed-certificate, guzzle gives me errors. Maybe the verify option should be set to false by default, and maybe it should even be configurable (not sure why though).Here is how I worked around this problem.
The text was updated successfully, but these errors were encountered: