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.

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度