菜单开关

周梦康 发表于 2019-01-21 1872 次浏览

最近系统升级,原来 php5.5 的代码搬到 php7.2 上就报错了

fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

方案一

https://stackoverflow.com/questions/32211301/ssl-error-ssl3-get-server-certificatecertificate-verify-failed
尝试下载 http://curl.haxx.se/ca/cacert.pem 并且添加到 php.ini

openssl.cafile=/home/admin/cacert.pem

重启无效

方案二

$php -r 'print_r(openssl_get_cert_locations());'
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] =>
    [ini_capath] =>
)

把刚刚从curl.haxx.se上下载的证书覆盖到default_cert_file路径。重启 php-fpm 问题解决了。

https://my.oschina.net/bubifengyun/blog/469277

评论列表