Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14088254
D12106.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12106.diff
View Options
diff --git a/src/future/http/HTTPSFuture.php b/src/future/http/HTTPSFuture.php
--- a/src/future/http/HTTPSFuture.php
+++ b/src/future/http/HTTPSFuture.php
@@ -9,6 +9,7 @@
private static $results = array();
private static $pool = array();
private static $globalCABundle;
+ private static $globalUserCert;
private static $blindTrustDomains = array();
private $handle;
@@ -118,6 +119,38 @@
}
/**
+ * Set the global user certificate if one is not specified
+ * for the session, given a path.
+ *
+ * @param string The path to a valid user SSL certificate
+ * @return void
+ */
+ public static function setGlobalUserCertFromPath($path) {
+ self::$globalUserCert = $path;
+ }
+ /**
+ * Set the global user certificate if one is not specified
+ * for the session, given a string.
+ *
+ * @param string The certificate
+ * @return void
+ */
+ public static function setGlobalUserCertFromString($certificate) {
+ $temp = new TempFile();
+ Filesystem::writeFile($temp, $certificate);
+ self::$globalUserCert = $temp;
+ }
+
+ /**
+ * Get the global user SSL certificate
+ *
+ * @return string
+ */
+ public static function getGlobalUserCert() {
+ return self::$globalUserCert;
+ }
+
+ /**
* Set a list of domains to blindly trust. Certificates for these domains
* will not be validated.
*
@@ -346,6 +379,11 @@
curl_setopt($curl, CURLOPT_CAINFO, $this->getCABundle());
}
+
+ if (self::getGlobalUserCert()) {
+ curl_setopt($curl, CURLOPT_SSLCERT, self::getGlobalUserCert());
+ }
+
$domain = id(new PhutilURI($uri))->getDomain();
if (!empty(self::$blindTrustDomains[$domain])) {
// Disable peer verification for domains that we blindly trust.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 2:22 AM (10 h, 48 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6784686
Default Alt Text
D12106.diff (1 KB)
Attached To
Mode
D12106: T7616: Arcanist to be able to access site requiring client side SSL certificate
Attached
Detach File
Event Timeline
Log In to Comment