public static function getDefaultCaBundle()
    {
        static $cached = null;
        static $cafiles = [
            // Red Hat, CentOS, Fedora (provided by the ca-certificates package)
            '/etc/pki/tls/certs/ca-bundle.crt',
            // Ubuntu, Debian (provided by the ca-certificates package)
            '/etc/ssl/certs/ca-certificates.crt',
            // FreeBSD (provided by the ca_root_nss package)
            '/usr/local/share/certs/ca-root-nss.crt',
            // OS X provided by homebrew (using the default path)
            '/usr/local/etc/openssl/cert.pem',
            // Windows?
            'C:\\windows\\system32\\curl-ca-bundle.crt',
            'C:\\windows\\curl-ca-bundle.crt',
        ];

        if ($cached) {
            return $cached;
        }

        if ($ca = ini_get('openssl.cafile')) {
            return $cached = $ca;
        }

        if ($ca = ini_get('curl.cainfo')) {
            return $cached = $ca;
        }

        foreach ($cafiles as $filename) {
            if (file_exists($filename)) {
                return $cached = $filename;
            }
        }

        throw new \RuntimeException(self::CA_ERR);
    }
public static function getDefaultCaBundle()
    {
        static $cached = null;
        static $cafiles = [
            // Red Hat, CentOS, Fedora (provided by the ca-certificates package)
            '/etc/pki/tls/certs/ca-bundle.crt',
            // Ubuntu, Debian (provided by the ca-certificates package)
            '/etc/ssl/certs/ca-certificates.crt',
            // FreeBSD (provided by the ca_root_nss package)
            '/usr/local/share/certs/ca-root-nss.crt',
            // OS X provided by homebrew (using the default path)
            '/usr/local/etc/openssl/cert.pem',
            // Windows?
            'C:\\windows\\system32\\curl-ca-bundle.crt',
            'C:\\windows\\curl-ca-bundle.crt',
        ];

        if ($cached) {
            return $cached;
        }

        if ($ca = ini_get('openssl.cafile')) {
            return $cached = $ca;
        }

        if ($ca = ini_get('curl.cainfo')) {
            return $cached = $ca;
        }

        foreach ($cafiles as $filename) {
            if (file_exists($filename)) {
                return $cached = $filename;
            }
        }

        throw new \RuntimeException(self::CA_ERR);
    }
public static function getDefaultCaBundle ( ) { static $ cached = null ; static $ cafiles = [ // Red Hat, CentOS, Fedora (provided by the ca-certificates package) '/etc/pki/tls/certs/ca-bundle.crt' , // Ubuntu, Debian (provided by the ca-certificates package) '/etc/ssl/certs/ca-certificates.crt' , // FreeBSD (provided by the ca_root_nss package) '/usr/local/share/certs/ca-root-nss.crt' , // OS X provided by homebrew (using the default path) '/usr/local/etc/openssl/cert.pem' , // Windows? 'C:\\windows\\system32\\curl-ca-bundle.crt' , 'C:\\windows\\curl-ca-bundle.crt' , ] ; if ( $ cached ) { return $ cached ; } if ( $ ca = ini_get ( 'openssl.cafile' ) ) { return $ cached = $ ca ; } if ( $ ca = ini_get ( 'curl.cainfo' ) ) { return $ cached = $ ca ; } foreach ( $ cafiles as $ filename ) { if ( file_exists ( $ filename ) ) { return $ cached = $ filename ; } } throw new \ RuntimeException ( self :: CA_ERR ) ; }
Returns the default cacert bundle for the current system.

First, the openssl.cafile and curl.cainfo php.ini settings are checked.
If those settings are not configured, then the common locations for
bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X
and Windows are checked. If any of these file locations are found on
disk, they will be utilized.

Note: the result of this function is cached for subsequent calls.

@return string
@throws \RuntimeException if no bundle can be found.
Returns the default cacert bundle for the current system .