puli / issues

The Puli issue tracker.
90 stars 5 forks source link

Error: "A valid cafile could not be located locally." prevents install and self-update #163

Open gossi opened 8 years ago

gossi commented 8 years ago

Hey,

I was about to update puli with puli self-update. However, this failed, because of:

$ puli self-update
fatal: A valid cafile could not be located locally.

So, I downloaded the phar manually and replaced mine. So I tried running self-update again, which failed (same output as above). So I tried to use the installer command curl https://puli.io/installer | php which throws a lot more errors:

$ curl https://puli.io/installer | php
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 45846  100 45846    0     0    97k      0 --:--:-- --:--:-- --:--:--   97k
All settings correct for using Puli
Downloading available versions...
A valid cafile could not be located locally.
Downloading available versions...
A valid cafile could not be located locally.
Downloading available versions...
A valid cafile could not be located locally.
fatal: The download failed repeatedly, aborting.

Is there maybe a server problem with the SSL-Certificate (because of the cafile warning) or is my installation broken?

webmozart commented 8 years ago

Thanks for the report! Hard to say, seems to be a problem with https://github.com/padraic/file_get_contents. @padraic any idea?

tgalopin commented 8 years ago

SSL ca files tried are these ones: https://github.com/padraic/file_get_contents/blob/master/src/Humbug/FileGetContents.php#L307. Can you check yours is present?

gossi commented 8 years ago

I fixed this for me. I'm on Mac OSX El Capitan and they use curl with their own transport security. Read here: http://curl.haxx.se/mail/archive-2013-10/0036.html

I used this script and will put it into my dotfiles (based on https://gist.github.com/1stvamp/2158128):

#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.46.0.tar.gz
tar xzf curl-7.46.0.tar.gz
cd curl-7.46.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/local/share/curl/ ]; then
    sudo mkdir -p /usr/local/share/curl/
else
    sudo mv /usr/local/share/curl/curl-ca-bundle.crt /usr/local/share/curl/curl-ca-bundle.crt.original
fi
sudo mv ca-bundle.crt /usr/local/share/curl/curl-ca-bundle.crt
echo

And alternative should be to visit https://puli.io in Safari so the cert gets added to the keychain. Read here: https://apple.stackexchange.com/questions/116286/ca-storage-for-curl-on-mavericks

Maybe add this to the troubleshooting section of the documentation.

Btw: composer self-update works :grin:

tgalopin commented 8 years ago

That's clearly something that should be mentioned in documentation, yes :) . It's great that the update works now!