PHP 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 /opt/tdoa/webroot/11.php on line 3 的解决办法
$url = 'https://192.200.0.30/';
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
"allow_self_signed"=>true,
),
);
$response = file_get_contents($url, false, stream_context_create($arrContextOptions));
//$fh= file_get_contents("https://192.200.0.30/");
echo $response;
博客主要讲述了PHP中出现SSL操作失败、证书验证失败错误的解决办法。给出了具体代码示例,通过设置SSL上下文选项,如不验证对等方、不验证对等方名称、允许自签名证书等,来解决file_get_contents函数在SSL操作时的问题。

3117

被折叠的 条评论
为什么被折叠?



