title: PHP/Laravel: cURL error 56: SSL read: error:00000000:lib
body: <p>I am getting this error on one function in my laravel application. yesterday everything worked fine.</p>
  
  <blockquote>
    <p>cURL error 56: SSL read: error:00000000:lib(0):func(0):reason(0), errno 104 (see <a href="http://curl.haxx.se/libcurl/c/libcurl-errors.html" rel="nofollow">http://curl.haxx.se/libcurl/c/libcurl-errors.html</a>)</p>
    
    <p>in CurlFactory.php line 187 at
    CurlFactory::createRejection(object(EasyHandle), array('errno' =>
    '56', 'error' => 'SSL read: error:00000000:lib(0):func(0):reason(0),
    errno 104', 'url' =>
    '<a href="https://server7.phasehosting.io:2087/json-api/dumpzone?&amp;domain=phasedev.be" rel="nofollow">https://server7.phasehosting.io:2087/json-api/dumpzone?&amp;domain=phasedev.be</a>',
    'content_type' => null, 'http_code' => '0', 'header_size' => '0',
    'request_size' => '1174', 'filetime' => '-1', 'ssl_verify_result' =>
    '0', 'redirect_count' => '0', 'total_time' => '2.30737',
    'namelookup_time' => '0.004516', 'connect_time' => '0.02006',
    'pretransfer_time' => '0.06986', 'size_upload' => '0', 'size_download'
    => '0', 'speed_download' => '0', 'speed_upload' => '0', 'download_content_length' => '-1', 'upload_content_length' => '-1',
    'starttransfer_time' => '0', 'redirect_time' => '0', 'redirect_url' =>
    '', 'primary_ip' => '37.97.192.223', 'certinfo' => array(),
    'primary_port' => '2087', 'local_ip' => '10.0.2.15', 'local_port' =>
    '48858')) in CurlFactory.php line 150</p>
  </blockquote>
  
  <p>When I specify the wrong parameters for the API call I get a server error response that I need to define the right parameters, when I specify the right parameters I get the Curl error.</p>
  
  <p>When using postman to make the request I get a successfull response</p>
  
  <p>Other API calls do work as intended. So I'm kind of confused right now. Where should I look?</p>
  
  <p>This is the function that runs the query:</p>
  
  <pre><code>    protected function runQuery($action, $arguments)
      {
          $host = $this-&gt;getHost();
          $client = new Client(['base_uri' =&gt; $host]);
          try{
            $response = $client-&gt;post('/json-api/' . $action, [
                'headers' =&gt; $this-&gt;createHeader(),
                // 'body'    =&gt; $arguments[0],
                'verify' =&gt; false,
                'query' =&gt; $arguments,
                'timeout' =&gt; $this-&gt;getTimeout(),
                'connect_timeout' =&gt; $this-&gt;getConnectionTimeout()
            ]);
  
            return (string) $response-&gt;getBody();
          }
          catch(\GuzzleHttp\Exception\ClientException $e)
          {
            return $e-&gt;getMessage();
          }
      }
  </code></pre>