Reputation: 1456
I'm making several cURL requests to a page. After this one POST request, I get this error in my cURL output
* Protocol https not supported or disabled in libcurl
* Closing connection -1
cURL doesn't even make the request. I can't figure out how to solve this error.
The weird thing is that SSL is enabled for both my CLI and FPM. Seen here http://cl.ly/image/1L062C2h2M2W
I tried making the request to an http:// instead of https://. That didn't change anything. I even tried making sure my server had an SSL, and that didn't change it.
My cURL calls look like this
$fp2 = fopen('cookies/debug.txt', 'a');
fwrite($fp2, "\n $action");
fwrite($fp2, "\n $url");
fwrite($fp2, "\n ".sizeof($data));
fwrite($fp2, "\n ".json_encode($data));
fwrite($fp2, "\n_________________________________________\n");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($action == "POST") curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POSTREDIR, 3);
$fp = fopen('cookies/curl.txt', 'a');
curl_setopt($ch, CURLOPT_STDERR, $fp);
curl_setopt($ch, CURLOPT_COOKIEJAR, $this->strCookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $this->strCookie);
if($header) {
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
}
// Set the request as a POST FIELD for curl.
if($action == "POST") {
if(in_array("Content-Type:application/x-www-form-urlencoded", $header)) {
$data = http_build_query($data);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
// Get response from the server.
$res = curl_exec($ch);
fwrite($fp, "\n_________________________________________\n");
fwrite($fp, "\n$action $url\n");
return $res;
and the full debug of the last call is
______________about to try___________________________
POST https://sellercentral.amazon.com/gp/communication-manager/view-message.html/ref=ag_xx__cmread?ie=UTF8&addnFilter0=rs&arrivalDate=1417064517&clcmResponseTimeSuboptions=uwd&curPage=1&dateExactEnd=&dateExactStart=&dateFilter=7d&isInbox=1&itemsPerPage=20&marketplaceId=ATVPDKIKX0DER&messageId=A3OSG68VXPA9BV&msgIndex=1&otherPartyId=&pageNum=1&replyToEmail=0&searchBoxText=&showFilters=0&sortBy=ArrivalDate&sortOrder=Descending×tamp=1417070427&totalMsg=1&view=reader
* Protocol https not supported or disabled in libcurl
* Closing connection -1
The "about to try", is my own debugging. The two ** are the only output from cURL when I try this request.
Upvotes: 0
Views: 2112
Reputation: 1456
There was a space in front of the "https". The error was saying " https" is not supported.
Upvotes: 1