PHP-5.4升级到PHP-5.6遇到的问题
背景:php版本升级到5.6,程序访问其他的接口(https)接收不到数据,但是php5.4的正常。
原因:1、当使用 SSL/TLS 的时候,流封装器默认验证端点证书和主机名
All encrypted client streams now enable peer verification by default. By default, this will use OpenSSL's default CA bundle to verify the peer certificate. In most cases, no changes will need to be made to communicate with servers with valid SSL certificates, as distributors generally configure OpenSSL to use known good CA bundles.
The default CA bundle may be overridden on a global basis by setting either the openssl.cafile or openssl.capath configuration setting, or on a per request basis by using the cafile or capath context options.
While not recommended in general, it is possible to disable peer certificate verification for a request by setting the verify_peer context option to FALSE, and to disable peer name validation by setting the verify_peer_name context option to FALSE.
解决方法: