Fr3nch13/CakePHP Utilities

CaBundle
in package

Tags
author

Chris Smith chris@cs278.org

author

Jordi Boggiano j.boggiano@seld.be

Table of Contents

Properties

$caFileValidity  : array<string, bool>
$caPath  : string|null

Methods

getBundledCaBundlePath()  : string
Returns the path to the bundled CA file
getSystemCaRootBundlePath()  : string
Returns the system CA bundle path, or a path to the bundled one
isOpensslParseSafe()  : bool
Test if it is safe to use the PHP function openssl_x509_parse().
reset()  : void
Resets the static caches
validateCaFile()  : bool
Validates a CA file using opensl_x509_parse only if it is safe to use
caDirUsable()  : bool
caFileUsable()  : bool
getEnvVariable()  : string|false
glob()  : bool
isDir()  : bool
isFile()  : bool
isReadable()  : bool

Properties

$caFileValidity

private static array<string, bool> $caFileValidity = array()

$caPath

private static string|null $caPath

Methods

getBundledCaBundlePath()

Returns the path to the bundled CA file

public static getBundledCaBundlePath() : string

In case you don't want to trust the user or the system, you can use this directly

Return values
string

path to a CA bundle file

getSystemCaRootBundlePath()

Returns the system CA bundle path, or a path to the bundled one

public static getSystemCaRootBundlePath([LoggerInterface $logger = null ]) : string

This method was adapted from Sslurp. https://github.com/EvanDotPro/Sslurp

(c) Evan Coury me@evancoury.com

For the full copyright and license information, please see below:

Copyright (c) 2013, Evan Coury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Parameters
$logger : LoggerInterface = null

optional logger for information about which CA files were loaded

Return values
string

path to a CA bundle file or directory

isOpensslParseSafe()

Test if it is safe to use the PHP function openssl_x509_parse().

public static isOpensslParseSafe() : bool

This checks if OpenSSL extensions is vulnerable to remote code execution via the exploit documented as CVE-2013-6420.

Return values
bool

reset()

Resets the static caches

public static reset() : void

validateCaFile()

Validates a CA file using opensl_x509_parse only if it is safe to use

public static validateCaFile(string $filename[, LoggerInterface $logger = null ]) : bool
Parameters
$filename : string
$logger : LoggerInterface = null

optional logger for information about which CA files were loaded

Return values
bool

caDirUsable()

private static caDirUsable(string|false $certDir[, LoggerInterface|null $logger = null ]) : bool
Parameters
$certDir : string|false
$logger : LoggerInterface|null = null
Return values
bool

caFileUsable()

private static caFileUsable(string|false $certFile[, LoggerInterface|null $logger = null ]) : bool
Parameters
$certFile : string|false
$logger : LoggerInterface|null = null
Return values
bool

getEnvVariable()

private static getEnvVariable(string $name) : string|false
Parameters
$name : string
Return values
string|false

isReadable()

private static isReadable(string $certFileOrDir[, LoggerInterface|null $logger = null ]) : bool
Parameters
$certFileOrDir : string
$logger : LoggerInterface|null = null
Return values
bool

        
On this page

Search results