PHP Classes

File: src/Certainty.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  Certainty  >  src/Certainty.php  >  Download  
File: src/Certainty.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Certainty
Manage SSL certificate authority file used by PHP
Author: By
Last change:
Date: 3 years ago
Size: 934 bytes
 

Contents

Class file image Download
<?php
namespace ParagonIE\Certainty;

use
GuzzleHttp\Client;

/**
 * Class Certainty
 * @package ParagonIE\Certainty
 */
class Certainty
{
    const
REPOSITORY = 'paragonie/certainty';
    const
CHRONICLE_CLIENT_ID = 'Chronicle-Client-Key-ID';
    const
ED25519_HEADER = 'Body-Signature-Ed25519';

   
/**
     * @param Fetch|null $fetch
     * @return Client
     */
   
public static function getGuzzleClient(Fetch $fetch = null)
    {
        if (\
is_null($fetch)) {
           
$fetch = new Fetch();
        }
        return new
Client(
            [
               
'curl.options' => [
                   
// https://github.com/curl/curl/blob/6aa86c493bd77b70d1f5018e102bc3094290d588/include/curl/curl.h#L1927
                   
CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2 | (CURL_SSLVERSION_TLSv1 << 16)
                ],
               
'verify' => $fetch->getLatestBundle()->getFilePath()
            ]
        );
    }
}

For more information send a message to info at phpclasses dot org.