douwen3083 2015-09-04 08:21
浏览 268
已采纳

http \ Client-> enqueue(http \ Client \ Request) - > send()重置与服务器PHP的连接

I've just installed the module pecl_http 2.5.1 on my server, and I am attempting to send a get request to a different port of my site (which requires https) from the following php script:

if(!isset($_POST['user']) || !isset($_POST['pass']) || $_POST['user']=="" || $_POST['pass']=="")
{   
    header("Location:https://MY_IP:444/");
    exit;
}

require_once("contants.php");
//Usar información de Login contra el servicio REST
$request = new http\Client\Request("GET", SERVICE_URL."/login", ["Auth" => $_POST['user'].":".$_POST['pass']]);
$request->setOptions(["timeout"=>1]);
$client = new http\Client;
$client->enqueue($request)->send();
//$response=$client->getResponse();
//echo $response->getResponseCode();

Both user connection to this port and server connection to the port I am trying to contact via SERVICE_URL require https. But when I attempt to send the form to this page, my browser outputs a "Reset Connection" error, and refuses to go on as it supposes it is unsafe.

Why is this happening? Can PHP not keep more than one socket open and thus it has to close one to open the other one? How can I fix this?

  • 写回答

1条回答 默认 最新

  • doulian1852 2015-09-04 10:18
    关注

    Just checked. Apparently version 2.5.1 of the pecl_http extension module has a bug. This works totally fine on version 2.5.0. I'm letting the developer know.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 被蓝屏搞吐了,有偿求帮解答,Ai回复直接拉黑
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并