Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) #14

Closed
goodnesskay opened this issue Dec 31, 2016 · 20 comments

Comments

@goodnesskay
Copy link
Contributor

I got this error when I clicked on the pay button of the default form created in this package. What did I do wrong? Thanks

@unicodeveloper
Copy link
Owner

This is not from the package. This has to do with internet issues or the fact that you are trying to connect to a secure paystack page from localhost. What's the latest on this?

@goodnesskay
Copy link
Contributor Author

Okay. so anything I will bbe doign with the laravel/paysstack packagae must not be from localhost?

@unicodeveloper
Copy link
Owner

Try to map it to a valid url that doesn't have localhost in it and try again

@goodnesskay
Copy link
Contributor Author

I will try it and give a feedback. Thanks

@ibrahimlawal
Copy link
Contributor

@goodnesskay @unicodeveloper this might also be related to our server requiring TLSv1.2 connections only. Here's the Why: https://developers.paystack.co/v1.0/blog/tls-v12-requirement . A permanent fix would be to update your PHP, OpenSSL and cURL versions. This can be achieved by upgrading WAMP or XAMPP or MAMP if you are using any of them.

@unicodeveloper
Copy link
Owner

Awesome. Thank you @ibrahimlawal for this very useful info!

@goodnesskay
Copy link
Contributor Author

@ibrahimlawal Thanks a lot.. I am going to try it.

@badruayomaya
Copy link

@ibrahimlawal @unicodeveloper I tried what you both said. I used SSL over a valid FQDN and I upgraded to Openssl 1.0.2 (the tls post says 1.0.1 and above) and yet this issue still persists.

@goodnesskay is this resolved?

@badruayomaya
Copy link

@ibrahimlawal @unicodeveloper I'm using PHP 7, CURL 7.51.0, OpenSSL 1.0.2d. Any information would be really helpful

@badruayomaya
Copy link

One other thing, I have used Paystack with Opencart on this same server this week.

@ibrahimlawal
Copy link
Contributor

@badruayomaya Our OpenCart plugin uses a file_get_contents fallback which is not encouraged by PSR-2 compliant systems like Laravel. I've not seen many PHP 7 sites though. You're sure you want to use that in production? PHP 5.6 is just fine, I guess.

@badruayomaya
Copy link

@ibrahimlawal @unicodeveloper @goodnesskay
So I've seen the issue. Apparently (still need to investigate), a CURL request does not get the certificate from the browser, unlike HTTPS. We'll need to manually download the certificate of the site and add it to the PHP ini.

I got the certificate from here:

https://curl.haxx.se/ca/cacert.pem

Add the path to php.ini. You should see ;curl.cainfo under [curl]. Uncomment and add the path:

curl.cainfo = "path_to_cert\cacert.pem"

Restart apache and it'll work (at least mine did).

@ibrahimlawal
Copy link
Contributor

@badruayomaya Awesome!

@unicodeveloper
Copy link
Owner

unicodeveloper commented Feb 22, 2017

@badruayomaya Awesome. Do you mind doing a blog post on that? Many people actually do come across this issue and it will be nice to have medium/blog post that they can reference to help solve the issue.

@badruayomaya
Copy link

@unicodeveloper Kool. I'll whip something up shortly.

@badruayomaya
Copy link

@unicodeveloper @goodnesskay @ibrahimlawal
So I've written something on my medium page here:

https://medium.com/@badruayomaya/laravel-paystack-curl-error-e21ffbe9b384#.ckqx605b1

Please share as you please.

Cheers,
Badrudeen

@unicodeveloper
Copy link
Owner

Thank you very much @badruayomaya. I should put this in the wiki.

@goodnesskay
Copy link
Contributor Author

Nice @badruayomaya! I have it all working now. thanks @unicodeveloper

@unicodeveloper
Copy link
Owner

@badruayomaya Just saw your blog post land in my inbox as part of Laravel Daily's newsletter

screen shot 2017-02-23 at 4 26 38 pm

@badruayomaya
Copy link

@unicodeveloper That's cool. I guess they have some sort of bot scouring the Internet for anything Laravel.

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

No branches or pull requests

4 participants