Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Guzzle configuration: verify #63

Closed
wants to merge 1 commit into from
Closed

Conversation

DrSchimke
Copy link

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

I want to be able to disable the certification verification for guzzle client
@greg0ire
Copy link
Contributor

greg0ire commented Sep 2, 2016

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

@@ -54,6 +54,9 @@ public function configure(ArrayNodeDefinition $builder)
->scalarNode('base_url')
->defaultValue('http://localhost')
->end()
->booleanNode('verify')
->defaultValue(true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we are supposed to test our own API, which is sometimes self-signed in dev, would it be a bad practice to set ->defaultValue(false) ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think disabling the SSL cert check must be done on purpose, not by default

Copy link

@Tartare2240 Tartare2240 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple question about general good practices

@jcornide
Copy link

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

@forceedge01
Copy link

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

@forceedge01
Copy link

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

@forceedge01
Copy link

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);

@acoulton
Copy link
Contributor

Thanks for the contribution and sorry that this was never reviewed / merged. This extension was marked as abandoned on packagist a long time ago and we're going to formally archive it now, so I'll close this PR.

@acoulton acoulton closed this Jul 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants