title: Curl failed: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to fcm.googleapis.com:443 in Codeigniter
body: <p>I integrated Fire-base Notification CRUL Code with Codeigniter. sometimes I am getting an error but not all the times.</p>
  
  <p>I have integrated below code to the controller</p>
  
  <p>Controller Code</p>
  
  <pre><code>$newDate=Date('m-d-Y H:i:s');
  
  $test_str=$user-&gt;us_name. ' Clocked at '.$newDate;
  $res = array();
  
  $res['data']['title'] = $user-&gt;us_name.' - Clocked In';
  $res['data']['is_background'] = "TRUE";
  $res['data']['message'] = $test_str;
  $res['data']['image'] = 'http://api.androidhive.info/images/minion.jpg';
  $res['data']['payload'] = 'individual';
  $res['data']['timestamp'] = date('Y-m-d G:i:s');
  $res['data']['act_tab'] = 0;
  
  
  $cur_id1=$this-&gt;db-&gt;query("Select token from devices")-&gt;result();
  
  foreach($cur_id1 as $cur_id) {
  
      $fields = array('to' =&gt; $cur_id-&gt;token,'data' =&gt; $res);
      $this-&gt;notif_model-&gt;sendPushNotification($fields);
  }
  </code></pre>
  
  <p>Model Code</p>
  
  <pre><code>function sendPushNotification($fields) {
  
  
          // Set POST variables
          $url = 'https://fcm.googleapis.com/fcm/send';
  
          $headers = array(
              'Authorization: key=MyServerKey',
              'Content-Type: application/json'
          );
          // Open connection
          $ch = curl_init();
  
          // Set the url, number of POST vars, POST data
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_POST, true);
          curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
          // Disabling SSL Certificate support temporarly
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  
          curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
  
          // Execute post
          $result = curl_exec($ch);
          if ($result === FALSE) {
              die('Curl failed: ' . curl_error($ch));
          }
  
          // Close connection
          curl_close($ch);
  
          return $result;
      }
  </code></pre>
  
  <p>While running this sometimes I am getting the error</p>
  
  <blockquote>
    <p>Curl failed: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to fcm.googleapis.com:443</p>
  </blockquote>