error:14090086:SSL routines:ssl3_get_server_certificate

环境

[root@localhost dd]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost dd]# php -v
PHP 7.0.30 (cli) (built: Nov 30 2018 19:43:05) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologie

执行

composer require topthink/think-swoole

任意的 composer 都会报错

  [Composer\Downloader\TransportException]                                                                                                                                                                          
  The "https://packagist.org/p/bower-asset/jquery%24bb3abb67f6ef612384f9d36676629a23ab67e95bfe8cec7e1e463e68d52086bc.json" 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   




阅读 3.8k
2 个回答
新手上路,请多包涵

composer error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

php -r "print_r(openssl_get_cert_locations());"
下载 wget http://curl.haxx.se/ca/cacert...
替换默认的 default_cert_file
运行 composer diagnose 将碰到的问题都解决
编辑php.ini下的ini_cafile、ini_capath

Array
(
    [default_cert_file] => /etc/pki/tls/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /etc/pki/tls/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /etc/pki/tls/private
    [default_default_cert_area] => /etc/pki/tls
    [ini_cafile] => /etc/pki/tls/cert.pem
    [ini_capath] => /etc/pki/tls/
)

我弄了两天 就差重装centos7了 现在解决了 大概是这样的

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进