Curl error 60: ssl certificate problem: unable to get local issuer certificate wamp

Working solution assuming your on Windows using XAMPP:

XAMPP server

  1. Similar for other environment
    • download and extract for cacert.pem here (a clean file format/data)

//curl.haxx.se/docs/caextract.html

  1. Put it here in the following directory.

C:\xampp\php\extras\ssl\cacert.pem

  1. In your php.ini put this line in this section ("c:\xampp\php\php.ini"):
;;;;;;;;;;;;;;;;;;;; ; php.ini Options ; ;;;;;;;;;;;;;;;;;;;; curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
  1. Restart your webserver/apache

  2. Problem solved!

(Reference: //laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate)

Attention Wamp/Wordpress/windows users. I had this issue for hours and not even the correct answer was doing it for me, because i was editing the wrong php.ini file because the question was answered to XAMPP and not for WAMP users, even though the question was for WAMP.

here's what i did

Download the certificate bundle.

Put it inside of C:\wamp64\bin\php\your php version\extras\ssl

Make sure the file mod_ssl.so is inside of C:\wamp64\bin\apache\apache(version)\modules

Enable mod_ssl in httpd.conf inside of Apache directory C:\wamp64\bin\apache\apache2.4.27\conf

Enable php_openssl.dll in php.ini. Be aware my problem was that I had two php.ini files and I need to do this in both of them. First one can be located inside of your WAMP taskbar icon here.

and the other one is located in C:\wamp64\bin\php\php(Version)

find the location for both of the php.ini files and find the line curl.cainfo = and give it a path like this

curl.cainfo = "C:\wamp64\bin\php\php(Version)\extras\ssl\cacert.pem"

Now save the files and restart your server and you should be good to go

If you are using PHP 5.6 with Guzzle, Guzzle has switched to using the PHP libraries autodetect for certificates rather than it's process (ref). PHP outlines the changes here.

Finding out Where PHP/Guzzle is Looking for Certificates

You can dump where PHP is looking using the following PHP command:

var_dump(openssl_get_cert_locations());

Getting a Certificate Bundle

For OS X testing, you can use homebrew to install openssl brew install openssl and then use openssl.cafile=/usr/local/etc/openssl/cert.pem in your php.ini or Zend Server settings (under OpenSSL).

A certificate bundle is also available from curl/Mozilla on the curl website: //curl.haxx.se/docs/caextract.html

Telling PHP Where the Certificates Are

Once you have a bundle, either place it where PHP is already looking (which you found out above) or update openssl.cafile in php.ini. (Generally, /etc/php.ini or /etc/php/7.0/cli/php.ini or /etc/php/php.ini on Unix.)

I have been testing Statamic on my Windows 7 machine. I reported an issue in a previous thread and was given a nudge to find the answer. //statamic.com/forum/3709-cp-problem-communicating-with-the-statamic-outpost "RequestException in CurlFactory.php line 187: cURL error 60: SSL certificate problem: unable to get local issuer certificate"

I thought I would share the resulting steps toward the solution which worked for me.

  • download the latest version of "cacert.pem" from //curl.haxx.se/docs/caextract.html
  • rename the file to "cacert.pem.txt"
  • put the file in the WAMP ssl folder corresponding to your currently used php version(s). For me that was c:\wamp64\bin\php\php7.2.10\extras\ssl\cacert.pem.txt
  • add the following line under the "; php.ini Options ;" section of your php.ini file: curl.cainfo = "c:\wamp64\bin\php\php7.2.10\extras\ssl\cacert.pem.txt"

    (use the absolute path to wherever you put your cacert.pem.txt file)

  • "Restart All Services" in WAMP

That should do it!

Hope this helps.

If you don't know how to edit your php.ini file: - start WAMP - left click the green WAMP icon in your taskbar - hover on your PHP version until the flyout menu appears - click "php.ini" and it will open in your default text editor - add the line noted above - save the file.

Issue: Seen while using Guzzle while using WAMP.

Solution

You will first need to download the certificate from here cacert.pem

Once you have the file, copy it into C:\wamp64\bin\php\php7.4.0\extras\ssl (In my case its PHP version 7.4.0 but choose the version you are using).

Next, you need to make sure that file mod_ssl.so exists inside C:\wamp64\bin\apache\apache2.4.41\modules

Enable module mod_ssl in C:\wamp64\bin\apache\apache2.4.41\conf\httpd.conf like so LoadModule ssl_module modules/mod_ssl.so

Next we need to enable openssl extension like so extension=openssl. To enable this extension, you need to change php.ini files located in these places

You can find first php.ini file to edit from wamp control panel.

The other php.ini to edit is at C:\wamp64\bin\php\php7.4.0 (browse to your php version)

Finally you will need to provide location of cacert.pem you downloaded earlier. Add the location of this file on both php.ini file. Find line curl.cainfo = and replace with location of cert like so,

curl.cainfo = “C:\wamp64\bin\php\php7.4.0\extras\ssl\cacert.pem” (Make sure location is correct)

Finally restart WAMP and things should work now.

How to fix cURL error 60 SSL certificate problem?

Solution:.
Save the cacert. pem file anywhere on your system. Example: Since you're modifying both php. ... .
Open your php.ini file. If your php.ini file doesn't have the curl.cainfo line, just add it to the end of the file, then add the file path where you saved your cacert.pem file: ... .
Restart your server..

How do I fix curl 60 SSL certificate problem certificate has expired?

The only solution to this problem is to get your host to update the root certificate on your server. So, you need to contact your server host and ask them to insert a new cacert. pem file into their servers, and configure it within their php.

How install Cacert pem in php INI?

2 Answers.
Edit the /etc/ssl/certs/cacert. pem file, and add your new CA public key to the bottom..
Edit php. ini and add the line openssl. cafile=/etc/ssl/certs/cacert. pem to the top (or bottom)..
Restart the webserver..

How do I fix curl Error 77?

To fix the error,.
Initially, download cacert.pem. from //curl.haxx.se/ca/cacert.pem..
Add the following line to php.ini: curl.cainfo="/path/to/downloaded/cacert.pem" Furthermore, if the server is shared hosting, add the above value to . user. ini file in the public_html folder..
Restart PHP..

Toplist

Neuester Beitrag

Stichworte