Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

HTTP-ClientOption verify=>true wont arrive at Guzzle-Client in the most recent version. #395

Closed
rkrx opened this issue Mar 28, 2018 · 3 comments
Milestone

Comments

@rkrx
Copy link

rkrx commented Mar 28, 2018

I have the following (local) setup:

$configParams = [
	'client_id' => ...,
	'client_secret' => ...,
	'project' => ...,
	'clientOptions' => ['verify' => false]
];
...
$config = Commercetools\Core\Config::fromArray($configParams)->setContext($context);
...

It seems Commercetools\Core\Client\OAuth\Manager and Commercetools\Core\Client create distinct instances of Guzzle\Client, but only Commercetools\Core\Client passes 'verify' => false to it's Guzzle-Instance.

@jenschude
Copy link
Contributor

Could verify this and will create a fix for this. As a workaround for now to instantiate a guzzle http client with the verify option set you could do this:

$client = Client::of($config);
$client->getOauthManager()->getHttpClient(['verify' => false]);

@jenschude
Copy link
Contributor

In the next release the HTTP client of the OAuth manager can be configured with oauthClientOptions

I had to separate them as you can also manipulate the handler stack using the client options.

@jenschude jenschude added this to the v2.4 milestone Mar 29, 2018
@rkrx
Copy link
Author

rkrx commented Mar 29, 2018

I would suggest to replace all that overcomplicated logic with a Builder and use (constructor-injection-)DI everywhere instead of this outdated *Aware-approach.
I'd expect a remarkable reduction in LOC and complexity, which I would really welcome here 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants