收藏
回答

SSL: Connection reset by peer怎么办?

通过访问https://api.weixin.qq.com进行身份认证,返回如下错误,file_get_contents(): SSL: Connection reset by peer,请问如何解决?

回答关注问题邀请回答
收藏

1 个回答

  • 维她命系
    维她命系
    2021-02-06

    建议使用curl函数访问https链接。

    file_get_contents 参考下面代码试试

    $arrContextOptions = array(
        "ssl" => array(
            "allow_self_signed" => true,
            "verify_peer" => false,
            "verify_peer_name" => false,
        ),
    );
    
    file_get_contents("https://域名/", false, stream_context_create($arrContextOptions));
    




    2021-02-06
    有用
    回复
登录 后发表内容
问题标签