Skip to content

Instantly share code, notes, and snippets.

@cbergau
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbergau/ed6036dd9b19cc5bd9d3 to your computer and use it in GitHub Desktop.
Save cbergau/ed6036dd9b19cc5bd9d3 to your computer and use it in GitHub Desktop.
Composer SSL Fix

This is a fix that worked for me when having this error:

[Composer\Downloader\TransportException]                                                                                       
  The "https://getcomposer.org/version" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:  
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed                                              
  Failed to enable crypto                                                                                                        
  failed to open stream: operation failed  

Download CRT file

cd /etc/ssl/certs
sudo wget https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt

Goto php.ini and put in this:

curl.cainfo=/etc/ssl/certs/ca-bundle.crt
openssl.cafile=/etc/ssl/certs/ca-bundle.crt

Now php composer.phar self-udpate should work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment