Slinky
Slinky

Reputation: 5832

cURL Error 1: Unsupported protocol: https

All,

I am trying to HTTPS POST a SOAP request via PHP's cURL wrapper methods but keep getting the following cURL error: Error 1: Unsupported protocol: https, Any ideas why this is happening? The target URL is good and I'm able to reach it via commandline.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$this->apiURL);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-type: text/xml;charset=UTF-8',
    'Content-length: '.strlen($SOAPRequest),
    'SOAPAction: ""'
) ); 

curl_setopt($ch, CURLOPT_POSTFIELDS, $SOAPRequest);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

$result = curl_exec($ch);

Upvotes: 4

Views: 21090

Answers (2)

Wasim Karani
Wasim Karani

Reputation: 8886

First check phpinfo();

If Curl is enabled in PHP as shown in the results of phpinfo() then

  • The problem could be an extraneous space in the MySQL field containing the URL. The error isn't that the "HTTPS" protocol is unsupported, it is that " HTTPS" (with leading space) is unsupported.

Upvotes: 7

Andries Mooij
Andries Mooij

Reputation: 153

Your PHP was compiled without SSL support.

Upvotes: 0

Related Questions