4

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);
2
  • try after disabling SELinux (if running) and/or iptables Commented Jan 12, 2011 at 19:42
  • Also, where are you setting the remote certificate to use over https communication? unitstep.net/blog/2009/05/05/… Commented Jan 12, 2011 at 19:44

2 Answers 2

7

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.
Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, that was it - an extra space before HTTPS. Duh... Thanks!
0

Your PHP was compiled without SSL support.

1 Comment

Our PHP has been compiled with SSL support

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.