WebApiExtension icon indicating copy to clipboard operation
WebApiExtension copied to clipboard

Guzzle configuration: verify

Open DrSchimke opened this issue 7 years ago • 5 comments

I want to be able to disable the certification verification for guzzle client

DrSchimke avatar Sep 02 '16 13:09 DrSchimke

~~Shouldn't you be using this value somewhere, like maybe in #32 ?~~ Apparently it should be enough indeed

greg0ire avatar Sep 02 '16 15:09 greg0ire

It would be great if this is merged, I'm using a workaround and this could be quite helpful

jcornide avatar Mar 19 '17 08:03 jcornide

Can the maintainer please accept this PR? Its been open since 2016.. not cool to be honest.

forceedge01 avatar Jun 28 '18 09:06 forceedge01

For now overriding config with reflection - but honestly when the maintainer wakes up - please merge PR.

forceedge01 avatar Jun 28 '18 09:06 forceedge01

For now resorting to this:

        $api = $this->getExternalContext(WebApiContext::class);

        $reflection = new ReflectionObject($api);
        $reflectionMethod = $reflection->getMethod('getClient');
        $reflectionMethod->setAccessible(true);
        $client = $reflectionMethod->invoke($api);

        $reflection = new ReflectionObject($client);
        $reflectionProperty = $reflection->getProperty('config');
        $reflectionProperty->setAccessible(true);
        $config = $reflectionProperty->getValue($client);
        $config['verify'] = false;

        $reflectionProperty->setValue($client, $config);

forceedge01 avatar Jun 28 '18 09:06 forceedge01