FreeBSDphp5.6httpsfsockopen after php is upgraded to 5.6, fsockpen ('SSL: // www.baidu.com ', 443, $ errno, $ errstr, 10 );
Burst:
PHP Warning: fsockopen (): SSL operation failed with code 1. OpenSSL Error messages:
Error: 14090086: SSL routines: SSL3_GET_SERVER_CERTIFICATE: certificate
Obtain the path of the openssl. pem file loaded by php:
php -r "print_r(openssl_get_cert_locations());"
Array( [default_cert_file] => /usr/local/openssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /usr/local/openssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] => /usr/local/openssl/private [default_default_cert_area] => /usr/local/openssl [ini_cafile] => [ini_capath] => )
ls /usr/local/openssl/cert.pem
This file does not exist at all,
Make a soft connection:
ln -s /usr/local/share/certs/ca-root-nss.crt /usr/local/openssl/cert.pem
OK.