Error certificado SSL OpenSSL Composer

Ahora que ando trabajando con Composer, intenté instalar HomeStead para Vagrant y VirtualBox pero Composer me arrojó un error con un CA Certificado SSL, y es porque en el php.ini no estaba especificado. 

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

1

Bastó con buscarlo en el sistema:

MBP-de-alfonso:~ alfonso$ sudo find / -name cacert.pem
Password:
/Applications/Adobe Dreamweaver CC 2014.1/configuration/Certs/cacert.pem
/Applications/Utilities/Adobe Creative Cloud/CoreSync/Core Sync.app/Contents/Resources/cacert.pem
/Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool/certs/cacert.pem
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/opt/vagrant/embedded/cacert.pem
/Users/alfonso/.composer/cacert.pem

Yo elegí «/opt/vagrant/embedded/cacert.pem» y la ingresé a mi php.ini:

openssl.cafile=/opt/vagrant/embedded/cacert.pem

Y listo, mi Composer funcionando al 100%.

Lo podemos comprobar con el siguiente comando:

MBP-de-alfonso:~ alfonso$ php -r "var_dump(openssl_get_cert_locations());"

Con la siguiente salida:

array(8) {
  ["default_cert_file"]=>
  string(53) "/Applications/XAMPP/xamppfiles/share/openssl/cert.pem"
  ["default_cert_file_env"]=>
  string(13) "SSL_CERT_FILE"
  ["default_cert_dir"]=>
  string(50) "/Applications/XAMPP/xamppfiles/share/openssl/certs"
  ["default_cert_dir_env"]=>
  string(12) "SSL_CERT_DIR"
  ["default_private_dir"]=>
  string(52) "/Applications/XAMPP/xamppfiles/share/openssl/private"
  ["default_default_cert_area"]=>
  string(44) "/Applications/XAMPP/xamppfiles/share/openssl"
  ["ini_cafile"]=>
  string(32) "/opt/vagrant/embedded/cacert.pem"
  ["ini_capath"]=>
  string(0) ""
}

Si tuviste alguna duda no dudes en dejarnos tus comentarios y en breve nuestro staff te apoyará.

0Shares

Comentarios

Comentarios