首页 > 其他 > 详细

file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL

时间:2017-09-05 10:45:06      阅读:4225      评论:0      收藏:0      [点我收藏+]

原代码:

<?php
$response = file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidates?Street=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json");

echo $response; ?>
报错 file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL ...

修改后
<?php
$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  

$response = file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidates?Street=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json", false, stream_context_create($arrContextOptions));

echo $response; ?>

帮助文档:http://php.net/manual/en/migration56.openssl.php

file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL

原文:http://www.cnblogs.com/jiafeimao-dabai/p/7477392.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!