简体   繁体   中英

How to correctly fix CURL Error 60 with Laravel Socialite?

I've spend a good part of the last couple of days reading through all the solutions on stackoverflow and google but to no avail.

So the concrete problem:
I purchased an SSL certificate from namecheap for my webpage. This particular site is hosted on Amazon EC2, on an Amazon AMI (1).

The site is reachable through HTTPS, and even http://ssllabs.com confirms that both the ssl and the ca bundle are in good shape. However laravel socialite throws a curl 60 error peer cert not valid.

I've double and triple checked that everything is ok on the php.ini on the curl path, so no clue.

The weirdest part is that if i use the cert from https://curl.haxx.se/docs/caextract.html it works just fine!

So excuse the novice question, but am I SUPPOSED to use this cert for CURL? And another different set for https?

Thanks!

Update:

I've updated my php.ini with the cacert.pem path downloaded from https://curl.haxx.se/docs/caextract.html

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo="/var/www/html/cacert.php"

And now im getting a 77 error:

"cURL error 77:  (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"

Finally figured it out!

When I was setting up the SSL certificates for the webserver I wrote over the ca-bundle.crt on the route /etc/pki/tls/certs

Even though I was updating the configuration for the SSL at the php.ini and the ssl.conf files, CURL didnt want to play along. Reverting the changes and using the original server certificate fixed CURL, and i just renamed the https certificate.

Hope this helps someone with a similar problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM