0

i am using this package for laravel 5.7

composer require ipecompany/smsirlaravel

all my links are working fine but the package admin panel link gives the ssl error . i tried to download cacert.pem file and place it both on

C:\wamp64\bin\php\php7.1.9\extras\ssl\cacert.pem

and

C:\wamp64\bin\apache\apache2.4.27\bin\cacert.pem

but yet no luck with this error

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

and i am using wamp 3.1.0 and php version 7.1.9 so any idea how this error can be solved ??

Farshad
  • 1,830
  • 6
  • 38
  • 70
  • This problem is solved at https://stackoverflow.com/questions/29822686/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate – Saif Jan 28 '19 at 11:04

1 Answers1

1

Try to disable check:

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

UPDATE

ok, sorry, my bad, didn't noticed that you are using external package. This package uses Guzzle, to disable in Guzzle this check you need to add this option.

As an option you need to create your own class and extend this Ipecompany\Smsirlaravel\Smsirlaravel class and override methods. The bad thing is that in each method of this class class creates new instance of GuzzleClient, so you need to override all methods... I advice to add field to your class $client and in constructor just create it:

<?php

namespace App\Vendors\Smsirlaravel;

use Ipecompany\Smsirlaravel\Smsirlaravel;
use GuzzleHttp\Client;

class SendSmsIr extends Smsirlaravel {
  protected $client;

  public function __construct()
  {
    $this->client = new Client(['verify' => config('smsirlaravel.ssl_verify')]);
  }

  /** other methods */
}

in config/smsirlaravel.php just add this line to array

'ssl_verify' => false, // true, false or path to certificate '/path/to/cert.pem'