bunq / sdk_php

PHP SDK for bunq API
MIT License
83 stars 54 forks source link

BC support for older CURL versions on production #228

Open StanJansen opened 1 year ago

StanJansen commented 1 year ago

The CURLOPT_PINNEDPUBLICKEY is not supported on older CURL versions but it's hardcoded to be used. Sadly cannot upgrade CURL on short-term in this case, but in all tags compatible with PHP8 this is the case.

Steps to reproduce:

  1. Install a CURL version < 7.39.0 (CURLOPT_PINNEDPUBLICKEY got added in 7.39.0: https://www.php.net/manual/en/function.curl-setopt.php).
  2. Use the API Client with production

What should happen:

  1. The CURLOPT_PINNEDPUBLICKEY set in https://github.com/bunq/sdk_php/blob/develop/src/Http/ApiClient.php#L320 should not be set if the option does not exist in the CURL version of the server.

What happens:

  1. An error is thrown because the option is unknown.

SDK version and environment