cURL Error #:Unknown SSL protocol error

quotedquoted Member Posts: 20

I'm running into a problem with a synch script that has been active for a few months without any problem.
The error being returned is:

cURL Error #:Unknown SSL protocol error in connection to

What could be the reason for this sudden change?
Any idea on how it can be fixed?

Thank you.


  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator
    Hey @quoted, would you be able to provide us a copy of your request minus the tokens, clientID and secret 

    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • quotedquoted Member Posts: 20
    $curl = curl_init();

    curl_setopt_array($curl, array(
        "Authorization: Bearer {$lightspeed_access_token}"

    $response = curl_exec($curl);
    $err = curl_error($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
  • gregaricangregarican Member Posts: 866 
    edited November 2018
    It could be the deprecation of TLS 1.0 on the LS API end. See for specifics.

    You can explicitly state to use a higher TLS version in the CURL command line. For my Windows client the command line switch of --tlsv1.2  will force my client to make the connection using TLS 1.2, for example. As long as I have that library available on my computer. If you are using a Windows client, upgrading to newer .NET versions should automatically force the higher TLS version as default. 
  • quotedquoted Member Posts: 20
    I'm working in PHP on a Linux webserver. 

    I just tried to set TLS 1.2 using a command explained here:

    Unfortunately this blocks the script from working at all (just keeps on loading). 

    Dit anything change last night?
    Never got any of these problems before, script has been running every 10 minutes since two months without any problem.

    Any other ideas? I'm kinda stuck at the moment :-(
  • gregaricangregarican Member Posts: 866 
    If you trace the traffic you should see in the request header what TLS version is being used. If yours says TLS 1.0 then that likely is the issue.
  • quotedquoted Member Posts: 20
    Tried different things in the meantime, script is not always reacting the same, making it very difficult to debug. SSL error seems to have disappeared now.

    Could the problems have something to do with the leaky bucket limits?
  • gregaricangregarican Member Posts: 866 
    Only a packet trace or inspection of the response headers and body would expose that I'd think. If it was API limits being hit I'd think you'd see an HTTP 429 - Too Many Requests type of error right off the bar. Strange that it's intermittent...  
Sign In or Register to comment.