20

I am using Authorize.net in my application(its in OSCOMMERCE) , When the user making payment its returning empty response. I debugged and find that it returning this error:

Protocol https not supported or disabled in libcurl

I am sending a prober url starts with https there is no space in that https://secure.authorize.net/gateway/transact.dll

My application in shared hosting server. My doubt is this is server side problem or Programming problem ?

hakre
  • 193,403
  • 52
  • 435
  • 836
AnNaMaLaI
  • 4,064
  • 11
  • 53
  • 93

3 Answers3

42

I had this problem and it was because of space in url:

' https://www.google.com/recaptcha/api/siteverify'

as you see there is a space before https

parastoo
  • 2,211
  • 2
  • 21
  • 38
  • I've just hit a similar issue: I've copied the URL from a PowerPoint slide, and the `E2 80 8B` Unicode character (yes, the *Zero width space*) somehow slipped in just before the `http://`. Had "big fun" trying to find out, opening the `.bash_history` in the HEX editor was crucial. A lot of facepalms involved, indeed. – Jozef Chocholacek Apr 28 '20 at 08:18
29

For those that have https support but still get an error similar to below

[curl] 1: Protocol %20https not supported or disabled in libcurl [url] %20https://www.example.com/%20

Ensure that the URL is valid

  • Try on a basic URL such as https://www.example.com
  • Check your URLs and make sure no spaces at start/end of URL (as shown above as %20)
  • Check for characters in your URL likely to break the curl request
AnNaMaLaI
  • 4,064
  • 11
  • 53
  • 93
Carlton
  • 5,533
  • 4
  • 54
  • 73
  • I really appreciate your contribution, sometimes as developers we bypass some details, in my case there was a single quote at the end of my url and did'nt notice it, that was causing that error. best regards. – Ivan Juarez Feb 08 '17 at 23:40
  • It was awful : a webeditor add some invisible spaces before the https ! : path=​​https://jsonblob.com ... – François Breton Feb 10 '17 at 14:47
8

Create a script called info.php and in it put <?php phpinfo(); ?>. Save it somewhere on your site so you can access it from a browser.

Find the curl section and check what Protocols are supported. If https is not listed, then cURL was not built with SSL support and you cannot use https.

You can also look in the very first section for Registered PHP Streams and see if https is listed. If so, then you can fallback to use PHP's socket functions or functions such as file_get_contents() or fopen with a context.

Since you mention you are on a shared host, request that your host recompile PHP so that both PHP and curl are built with OpenSSL support so you can use encryption, otherwise you will need to find another solution.

drew010
  • 68,777
  • 11
  • 134
  • 162
  • 1
    in short, contact your hosting company, if they don't support it, you'll need to go to the ones that do. – marko Mar 07 '12 at 04:41
  • 10
    Thanks @drew010, but what shall I do if phpinfo() tells me that cURL supports HTTPS and it still throws this error? – AlexGrafe Dec 11 '13 at 15:40
  • 1
    If anyone has the problem where phpinfo() says https is enabled but still gets that error, comment and let me know. – drew010 Sep 16 '15 at 22:50
  • I am having exactly that problem: phpinfo() says https is a registered stream, SSL enabled for curl, and https is a protocol for curl....yet still getting the https not supported or disabled in libcurl – Robert Crooks Oct 12 '18 at 18:23