diff options
author | Ian Denhardt <ian@zenhack.net> | 2010-08-12 12:22:10 -0400 |
---|---|---|
committer | Ian Denhardt <ian@zenhack.net> | 2010-08-12 12:22:10 -0400 |
commit | df562a1d8f4515462b190a214a4b6642f7855130 (patch) | |
tree | 7346479c65ba44f717d17be9074b3586cacaa205 /lib | |
parent | e3b891f0b774c053ab3e269bfa1a29b39ee28599 (diff) | |
parent | 855f1f6623e64701796f443fc20fde164b1a1846 (diff) |
Merge branch '1.0.x' of git://gitorious.org/statusnet/mainline
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.php | 3 | ||||
-rw-r--r-- | lib/httpclient.php | 13 | ||||
-rw-r--r-- | lib/mailbox.php | 1 | ||||
-rw-r--r-- | lib/noticelist.php | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/lib/default.php b/lib/default.php index e0081f316..76e4e44cf 100644 --- a/lib/default.php +++ b/lib/default.php @@ -321,6 +321,7 @@ $default = 'maxlength' => 25, 'maxnoticelength' => -1), 'http' => // HTTP client settings when contacting other sites - array('ssl_cafile' => false // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt') + array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt') + 'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.) ), ); diff --git a/lib/httpclient.php b/lib/httpclient.php index b69f718e5..514a5afeb 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -145,6 +145,10 @@ class HTTPClient extends HTTP_Request2 $this->config['ssl_verify_peer'] = false; } + if (common_config('http', 'curl') && extension_loaded('curl')) { + $this->config['adapter'] = 'HTTP_Request2_Adapter_Curl'; + } + parent::__construct($url, $method, $config); $this->setHeader('User-Agent', $this->userAgent()); } @@ -204,6 +208,15 @@ class HTTPClient extends HTTP_Request2 protected function doRequest($url, $method, $headers) { $this->setUrl($url); + + // Workaround for HTTP_Request2 not setting up SNI in socket contexts; + // This fixes cert validation for SSL virtual hosts using SNI. + // Requires PHP 5.3.2 or later and OpenSSL with SNI support. + if ($this->url->getScheme() == 'https' && defined('OPENSSL_TLSEXT_SERVER_NAME')) { + $this->config['ssl_SNI_enabled'] = true; + $this->config['ssl_SNI_server_name'] = $this->url->getHost(); + } + $this->setMethod($method); if ($headers) { foreach ($headers as $header) { diff --git a/lib/mailbox.php b/lib/mailbox.php index 90a58b4c4..2b00f5ffd 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -224,6 +224,7 @@ class MailboxAction extends CurrentUserDesignAction if ($message->source) { $this->elementStart('span', 'source'); + // FIXME: bad i18n. Device should be a parameter (from %s). $this->text(_('from')); $this->element('span', 'device', $this->showSource($message->source)); $this->elementEnd('span'); diff --git a/lib/noticelist.php b/lib/noticelist.php index 252e1ca90..dbc5bfb51 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -502,6 +502,7 @@ class NoticeListItem extends Widget $source_name = (empty($ns->name)) ? _($ns->code) : _($ns->name); $this->out->text(' '); $this->out->elementStart('span', 'source'); + // FIXME: probably i18n issue. If "from" is followed by text, that should be a parameter to "from" (from %s). $this->out->text(_('from')); $this->out->text(' '); |