bunq / sdk_php

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

cURL error 60: SSL certificate problem: unable to get local issuer certificate #104

Closed dqos closed 6 years ago

dqos commented 6 years ago

Steps to reproduce:

Executing https://github.com/bunq/sdk_php/blob/develop/example/api_context_save_example.php

What happens:

Throws error, not sure why. In sandbox mode you can append VERIFY_PEER option to cURL request to ignore it.

Traceback

[Fri Jan 12 16:38:36 2018] PHP Fatal error:  Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187
Stack trace:
#0 C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactor in C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187
[Fri Jan 12 16:38:36 2018] ::1:60995 [500]: /bunq/index.php - Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187
Stack trace:
#0 C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactor in C:\Users\REMOVED\Google Drive\PROJECT\bunq\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

SDK version and environment

dqos commented 6 years ago

Update: this issue only occurs on Windows 10, PHP 7. Works on Linux.

basst85 commented 6 years ago

Check this: https://github.com/yabacon/paystack-php/wiki/cURL-error-60:-SSL-certificate-problem:-unable-to-get-local-issuer-certificate-(see-http:--curl.haxx.se-libcurl-c-libcurl-errors.html)

Can you maybe try that?

OGKevin commented 6 years ago

@qarizma any updates regarding the solution @basst85 provided ?

dqos commented 6 years ago

@OGKevin this was caused by using the script on Windows, I used it for testing, but after running it on Linux it worked.

jimkaler commented 6 years ago

@OGKevin how to remove curl:60 error while installing vendor\bin\bunq-install via command line. I have already set it up what sollution given by @basst85. I am unable to install vendor\bin\bunq-install after giving proxy information i got curl:60 error.

jimkaler commented 6 years ago

@OGKevin, @basst85 please check it and help me to overcome this,

C:\Users\win\Desktop\bunqTest>vendor\bin\bunq-install Choose an environment (SANDBOX/PRODUCTION): SANDBOX Please provide your api key: 6ff5e3c864a15316772e40f5d7343cbfae2d8a46b8d9c38a5a9d02ad7454b552 Provide a proxy url, leave empty for no proxy (default: no proxy): resource(30) of type (OpenSSL key) error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:0E06D06C:configuration file routines:NCONF_get_string:no value
An unexpected error occurred: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

OGKevin commented 6 years ago

Unfortunately im not familiar with development on windows and therefore can not reproduce or fix this. Feel free to look into it and prove a PR.

Closing for now.