php-extended/php-certificate-provider-mozilla

A provider of certificates bundle of root authorities from the mozilla releases

7.0.39 2024-11-17 02:10 UTC

This package is auto-updated.

Last update: 2024-11-17 01:10:18 UTC


README

A provider of certificates bundle of root authorities from the mozilla releases.

coverage build status

This library was made to answer a common error : SSL certificate problem: unable to get local issuer certificate without disabling the certificate when calling the resolving library (like cURL) and without changing the server configuration in ini files.

This library uses the https://curl.haxx.se/ca/cacert.pem source file to update its contents. This library is updated once a week, every sunday.

Last Updated Date : 2024-11-17

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar php-extended/php-certificate-provider-mozilla ^7

Basic Usage

You may use this library the following way:


use PhpExtended\Certificate\MozillaCertificateProvider;

$ch = curl_init();

// set some curl options

$provider = new MozillaCertificateProvider();
$cacert_path = $provider->getCertificateFilePath();

curl_setopt($ch, CURLOPT_CAINFO, $cacert_path);
curl_setopt($ch, CURLOPT_CAPATH, $cacert_path);

curl_exec($ch);

curl_close($ch);

License

MIT (See license file).