guzzle-oauth2-subscriber icon indicating copy to clipboard operation
guzzle-oauth2-subscriber copied to clipboard

It seems not possible to forward custom Guzzle options to the handler

Open RoNoLo opened this issue 4 years ago • 1 comments

In guzzle it is possible to add cURL options via the $options and the ['curl'] key. I happens to have to deal with a expired SSL cert by a companies sandbox uri. I think I could just move forward, when I add the curl Option to ignore the ssl verify.

This option is ignored in the getAccessToken() process from this middleware. I tracked it down to the ClientCredentials.php:70 where the send($request) is done without an $options array. I think there should be something to forward curl options down the callstack.

RoNoLo avatar Apr 14 '20 10:04 RoNoLo

Hi @RoNoLo, sorry about the slow delay! You can set 'verify' => false on the Guzzle client itself so all requests are unverified:

// Authorization client - this is used to request OAuth access tokens
$reauth_client = new GuzzleHttp\Client([
    // Disable SSL verification
    'verify' => false,
]);
$reauth_config = [
    // ...
];
$grant_type = new ClientCredentials($reauth_client, $reauth_config);
$oauth = new OAuth2Subscriber($grant_type);

kamermans avatar Sep 15 '20 20:09 kamermans