From 5e3b4360996a3eea3d7c0bcbc5c00e2379091de8 Mon Sep 17 00:00:00 2001 From: Eric Stern Date: Sun, 4 Aug 2013 08:21:35 -0700 Subject: [PATCH] Pass global CA bundle to HTTPSFuture, T3668 Summary: Update and clarify precedence of CA bundles Test Plan: tested with "arc call-conduit user.whoami" from project root Same from other subdirectory in project Repeated tests with both https.cabundle and https.cacert settings, both in .arcconfig and ~/.arcrc Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T3668 Differential Revision: https://secure.phabricator.com/D6647 --- scripts/arcanist.php | 7 +++++++ src/configuration/ArcanistSettings.php | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 69ac1db6..0374f78f 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -201,6 +201,13 @@ try { } $workflow->setConduitURI($conduit_uri); + // Apply global CA bundle from configs. + if ($ca_bundle = $working_copy->getConfigFromAnySource('https.cabundle')) { + $ca_bundle = Filesystem::resolvePath( + $ca_bundle, $working_copy->getProjectRoot()); + HTTPSFuture::setGlobalCABundleFromPath($ca_bundle); + } + if ($need_conduit) { if (!$conduit_uri) { diff --git a/src/configuration/ArcanistSettings.php b/src/configuration/ArcanistSettings.php index f50f1cbf..da9167c6 100644 --- a/src/configuration/ArcanistSettings.php +++ b/src/configuration/ArcanistSettings.php @@ -95,6 +95,14 @@ final class ArcanistSettings { "'vim'. This setting overrides the EDITOR environmental variable.", 'example' => '"nano"', ), + 'https.cabundle' => array( + 'type' => 'string', + 'help' => + "Path to a custom CA bundle file to be used for arcanist's cURL ". + "calls. This is used primarily when your conduit endpoint is ". + "behind https signed by your organization's internal CA.", + 'example' => 'support/yourca.pem' + ), 'browser' => array( 'type' => 'string', 'help' => -- 2.43.0