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?