SSL例程:tls_process_server_certificate:证书验证失败未能启用加密

时间:2018-09-22 13:57:11

标签: php ssl openssl xampp composer-php

当我尝试在系统上安装Composer时,总是会出现此错误

    The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed

我使用了php -r'print_r(openssl_get_cert_locations());'命令查看php默认证书位置,结果如下:

    Array
(
    [default_cert_file] => C:\usr\local\ssl/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => C:\usr\local\ssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => C:\usr\local\ssl/private
    [default_default_cert_area] => C:\usr\local\ssl
    [ini_cafile] => C:\xampp\apache\cert.pem
    [ini_capath] =>
)

C:\ usr \ local \ ssl / cert.pem不存在,因此我从http://curl.haxx.se/ca/cacert.pem下载了ssl证书并手动创建了C:\ usr \ local \ ssl / cert.pem,但仍然没有成功。 我真的需要一个解决方案,因为我没有选择权,或者有没有办法可以绕过ssl证书验证。

0 个答案:

没有答案