我正在获取 file_get_contents 返回 SSL 例程:ssl3_get_server_certificate:证书

问题描述 投票:0回答:1

当我将 file_get_contents 与来自另一台服务器的 URL 一起使用时,出现以下错误。

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 /home/test/public_html/.....

Warning: file_get_contents(): Failed to enable crypto in /home/test/public_html/...... on line 24

Warning: file_get_contents(https://......): failed to open stream: operation failed in /home/test/public_html/......php on line 24

这是我的第四个 VPS。前 3 个工作绝对正常,但这个由于某种原因给出了上述错误。此 VPS 上的设置是相同的。

备注:

  • allow_url_fopen 已开启
  • 目标服务器上的https没问题
  • SSLv3 由于已被弃用而在目标服务器上被禁用。

当我使用时它起作用:

$arrContextOptions=array(
   "ssl"=>array(
        "verify_peer"=>false,
         "verify_peer_name"=>false,
   ),
);

但是有些插件使用file_get_contents,由于更新我无法修改它。

可能是什么问题?

php linux centos7 file-get-contents
1个回答
0
投票

几天前我也经历过类似的情况此链接可能会

© www.soinside.com 2019 - 2024. All rights reserved.