Coder Social home page Coder Social logo

Comments (1)

norkunas avatar norkunas commented on August 17, 2024

Hello @vhanded,

This is probably related to your webserver cURL configuration. In short you must provide a local list of certicificates which will be checked when you are making a request with SSL to secure from "man in the middle" attacks. You can read about cacert.pem file here http://serverfault.com/questions/241046/what-is-the-cacert-pem-and-for-what-to-use-that.

I recommend you to download the cacert.pem file from http://curl.haxx.se/ca/cacert.pem and place it in your server and configure the path to that file and then the exception should disappear.

But if you can't modify PHP configuration then there is another option. Since this package uses Guzzle, you can create a Guzzle client before OneSignal and pass to constructor as a second parameter.

use GuzzleHttp\Client;

$guzzle = new Client([
    'defaults' => [
        'headers' => [
            'Accept' => 'application/json',
        ],
        'cert' => '/path/to/cacert.pem',
    ],
]));

$oneSignal = new \OneSignal\OneSignal(.., $guzzle);

Also about guzzle configuration you can read here: http://docs.guzzlephp.org/en/5.3/clients.html?highlight=cert#verify

from onesignal-php-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.