php5.4 cacert.pem,Certainty - 自动化cacert.pem管理的PHP项目

Certainty - CA-Cert Automation for PHP Projects

68747470733a2f2f7472617669732d63692e6f72672f70617261676f6e69652f6365727461696e74792e7376673f6272616e63683d6d617374657268747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f6365727461696e74792f762f737461626c6568747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f6365727461696e74792f762f756e737461626c6568747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f6365727461696e74792f6c6963656e736568747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617261676f6e69652f6365727461696e74792e737667

Automate your PHP projects' cacert.pem management. Read the blog post introducing Certainty.

Requires PHP 5.5 or newer. Certainty should work on any operating system (including Windows), although the symlink feature may not function in Virtualbox Shared Folders.

Who is Certainty meant for?

Open source developers with no control over where their code is deployed (e.g. Magento module developers).

People whose code might be deployed in weird environments with CACert bundles that are outdated or in unpredictable locations.

People who are generally forced between:

Disabling certificate validation entirely, or

Increasing their support burden to deal with corner-cases where suddenly HTTP requests are failing on weird systems

Certainty allows your software to "just work" (which is usually the motivation for disabling certificate validation) without being vulnerable to man-in-the-middle attacks.

Motivation

Many HTTP libraries require you to specify a file path to a cacert.pem file in order to use TLS correctly. Omitting this file means either disabling certificate validation entirely (which enables trivial man-in-the-middle exploits), connection failures, or hoping that your library falls back safely to the operating system's bundle.

In short, the possible outcomes (from best to worst) are as follows:

Specify a cacert file, and you get to enjoy TLS as it was intended. (Secure.)

Omit a cacert file, and the OS maybe bails you out. (Uncertain.)

Omit a cacert file, and it fails closed. (Connection failed. Angry customers.)

Omit a cacert file, and it fails open. (Data compromised. Hurt customers. Expensive legal proceedings.)

Obviously, the first outcome is optimal. So we built Certainty to make it easier to ensure open source projects do this.

Installing Certainty

From Composer:

composer require paragonie/certainty:^2

Certainty will keep certificates up to date via RemoteFetch, so you don't need to update Certainty library just to get fresh CA-Cert bundles. Update only for bugfixes (especially security fixes) and new features.

Non-Supported Use Case:

If you are not using RemoteFetch (which is strongly recommended that you do, and we only provide support for systems that do use RemoteFetch), then you want to use dev-master rather than a version constraint, due to the nature of CA Certificates.

If a major CA gets compromised and their certificates are revoked, you don't want to continue trusting these certificates.

Furthermore, in the event of avoiding RemoteFetch, you should be running composer update at least once per week to prevent stale CA-Cert files from causing issues.

Using Certainty

What Certainty Does

Certainty maintains a repository of all the cacert.pem files since 2017, along with a sha256sum and Ed25519 signature of each file. When you request the latest bundle, Certainty will check both these values (the latter can only be signed by a key held by Paragon Initiative Enterprises, LLC) for each entry in the JSON value, and return the latest bundle that passes validation.

The cacert.pem files contained within are reproducible from Mozilla's bundle.

How is Certainty different from composer/ca-bundle?

The key differences are:

Certainty will keep the CA-Cert bundles on your system up-to-date even if you do not run composer update.

We sign our CA-Cert bundles using Ed25519, and check every update into the PHP community Chronicle.

Support Contracts

If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值