phar-io / phive

The Phar Installation and Verification Environment (PHIVE)
https://phar.io
BSD 3-Clause "New" or "Revised" License
579 stars 43 forks source link

Allow setting a cafile like composer allows to override corporate certificate replacers #418

Open gullevek opened 10 months ago

gullevek commented 10 months ago

composer allows to set a "cafile" or "capth" option to override the cafile set by curl php

See https://getcomposer.org/doc/06-config.md#cafile or https://getcomposer.org/doc/06-config.md#capath

Current problem is that I cannot get phive to accept the "ca pem" file from our corporate vpn system. With composer I can override this.

Note: I have set global openssl, curl, etc config for this because directly accessing the repositories.xml will work.

$ phive list
Phive 0.15.2 - Copyright (C) 2015-2023 by Arne Blankerts, Sebastian Heuer and Contributors
Fetching repository list
Downloading https://phar.io/data/repositories.xml
 ╰|========================================>| 138 B / 138 B - 100%[ERROR]   Unexpected HTTP error: getpeername() failed with errno 57: Socket is not connected (while requesting https://phar.io/data/repositories.xml)
[ERROR]   
[ERROR]   This likely means your curl installation is incomplete and can not verify certificates.
[ERROR]   Please install a cacert.pem (for instance from https://curl.haxx.se/docs/caextract.html) and try again. (Code: 60)