操作系统更新后,PHP 函数 file_get_contents() 导致 SSL 错误

操作系统更新后,PHP 函数 file_get_contents() 导致 SSL 错误

在我定期更新并重新启动服务器后,我访问了服务器的一个网页并收到以下错误:

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: 
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in 
/var/www/domain.ca/public_html/page.php on line 51

Warning: file_get_contents(): Failed to enable crypto in /var/www/domain.ca/public_html/
page.php on line 51

Warning: file_get_contents(https://www.cryptopia.co.nz/api/GetMarkets/BTC): failed to open 
stream: operation failed in /var/www/domain.ca/public_html/page.php on line 51

经过更多测试后,我的其他 file_get_contents() 运行良好。我看到的与 cryptopia 的唯一区别是他们使用 Comodo 证书。所以我猜这与问题有关,但我没有找到解决方案。

操作系统是 Ubuntu Server 16.04.3,PHP 是版本 7.0.22。

欢迎任何帮助!

答案1

看起来 Cryptopia 或 Comodo 已经做出了一些改变,因为这个问题在几天后就自行解决了。

感谢那些试图提供帮助的人。

我会在一两天后删除这个问题,以便评论者看到这个“解决方案”。

相关内容