{"id":13409261,"url":"https://github.com/composer/ca-bundle","last_synced_at":"2025-05-13T16:05:46.570Z","repository":{"id":7027631,"uuid":"55974346","full_name":"composer/ca-bundle","owner":"composer","description":"Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.","archived":false,"fork":false,"pushed_at":"2025-04-16T08:02:10.000Z","size":968,"stargazers_count":2951,"open_issues_count":1,"forks_count":39,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-03T07:49:45.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/composer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://packagist.com","tidelift":"packagist/composer/composer","github":"composer"}},"created_at":"2016-04-11T13:23:29.000Z","updated_at":"2025-04-18T09:47:31.000Z","dependencies_parsed_at":"2024-02-23T11:29:34.431Z","dependency_job_id":"ec93f7af-0d71-48df-b6f4-f1de5b1535f7","html_url":"https://github.com/composer/ca-bundle","commit_stats":{"total_commits":119,"total_committers":35,"mean_commits":3.4,"dds":0.73109243697479,"last_synced_commit":"3b1fc3f0be055baa7c6258b1467849c3e8204eb2"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fca-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fca-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fca-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fca-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composer","download_url":"https://codeload.github.com/composer/ca-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590528,"owners_count":21772935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:00:59.316Z","updated_at":"2025-05-05T22:50:35.535Z","avatar_url":"https://github.com/composer.png","language":"PHP","funding_links":["https://packagist.com","https://tidelift.com/funding/github/packagist/composer/composer","https://github.com/sponsors/composer"],"categories":["PHP"],"sub_categories":[],"readme":"composer/ca-bundle\n==================\n\nSmall utility library that lets you find a path to the system CA bundle,\nand includes a fallback to the Mozilla CA bundle.\n\nOriginally written as part of [composer/composer](https://github.com/composer/composer),\nnow extracted and made available as a stand-alone library.\n\n\nInstallation\n------------\n\nInstall the latest version with:\n\n```bash\n$ composer require composer/ca-bundle\n```\n\n\nRequirements\n------------\n\n* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.\n\n\nBasic usage\n-----------\n\n### `Composer\\CaBundle\\CaBundle`\n\n- `CaBundle::getSystemCaRootBundlePath()`: Returns the system CA bundle path, or a path to the bundled one as fallback\n- `CaBundle::getBundledCaBundlePath()`: Returns the path to the bundled CA file\n- `CaBundle::validateCaFile($filename)`: Validates a CA file using openssl_x509_parse only if it is safe to use\n- `CaBundle::isOpensslParseSafe()`: Test if it is safe to use the PHP function openssl_x509_parse()\n- `CaBundle::reset()`: Resets the static caches\n\n\n#### To use with curl\n\n```php\n$curl = curl_init(\"https://example.org/\");\n\n$caPathOrFile = \\Composer\\CaBundle\\CaBundle::getSystemCaRootBundlePath();\nif (is_dir($caPathOrFile)) {\n    curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile);\n} else {\n    curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile);\n}\n\n$result = curl_exec($curl);\n```\n\n#### To use with php streams\n\n```php\n$opts = array(\n    'http' =\u003e array(\n        'method' =\u003e \"GET\"\n    )\n);\n\n$caPathOrFile = \\Composer\\CaBundle\\CaBundle::getSystemCaRootBundlePath();\nif (is_dir($caPathOrFile)) {\n    $opts['ssl']['capath'] = $caPathOrFile;\n} else {\n    $opts['ssl']['cafile'] = $caPathOrFile;\n}\n\n$context = stream_context_create($opts);\n$result = file_get_contents('https://example.com', false, $context);\n```\n\n#### To use with Guzzle\n\n```php\n$client = new \\GuzzleHttp\\Client([\n    \\GuzzleHttp\\RequestOptions::VERIFY =\u003e \\Composer\\CaBundle\\CaBundle::getSystemCaRootBundlePath()\n]);\n```\n\nLicense\n-------\n\ncomposer/ca-bundle is licensed under the MIT License, see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposer%2Fca-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposer%2Fca-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposer%2Fca-bundle/lists"}