共计 786 个字符,预计需要花费 2 分钟才能阅读完成。
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
php curl 执行 https 申请时报错如上
下载 cacert.pem
wget https://curl.haxx.se/ca/cacert.pem --no-check-certificat
mv cacert.pem /etc/pki/tls/certs/cacert.pem
批改 PHP OpenSSL 证书
php --ini
查看 php.ini
的门路
将原有的证书文件替换为下载的 cacert.pem
[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
; openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt
openssl.cafile=/etc/pki/tls/certs/cacert.pem
从新执行即可~
正文完