Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libs/Zend/Http/Client/Adapter/Proxy.php')
-rw-r--r--libs/Zend/Http/Client/Adapter/Proxy.php29
1 files changed, 17 insertions, 12 deletions
diff --git a/libs/Zend/Http/Client/Adapter/Proxy.php b/libs/Zend/Http/Client/Adapter/Proxy.php
index 932b1b66b6..cda6d62dbb 100644
--- a/libs/Zend/Http/Client/Adapter/Proxy.php
+++ b/libs/Zend/Http/Client/Adapter/Proxy.php
@@ -16,23 +16,23 @@
* @category Zend
* @package Zend_Http
* @subpackage Client_Adapter
- * @version $Id: Proxy.php 17118 2009-07-26 09:41:41Z shahar $
- * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id: Proxy.php 20947 2010-02-06 17:09:07Z padraic $
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Uri_Http
*/
-require_once 'Zend/Uri/Http.php';
+// require_once 'Zend/Uri/Http.php';
/**
* @see Zend_Http_Client
*/
-require_once 'Zend/Http/Client.php';
+// require_once 'Zend/Http/Client.php';
/**
* @see Zend_Http_Client_Adapter_Socket
*/
-require_once 'Zend/Http/Client/Adapter/Socket.php';
+// require_once 'Zend/Http/Client/Adapter/Socket.php';
/**
* HTTP Proxy-supporting Zend_Http_Client adapter class, based on the default
@@ -46,7 +46,7 @@ require_once 'Zend/Http/Client/Adapter/Socket.php';
* @category Zend
* @package Zend_Http
* @subpackage Client_Adapter
- * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
@@ -91,6 +91,11 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
if (! $this->config['proxy_host']) {
return parent::connect($host, $port, $secure);
}
+
+ /* Url might require stream context even if proxy connection doesn't */
+ if ($secure) {
+ $this->config['sslusecontext'] = true;
+ }
// Connect (a non-secure connection) to the proxy server
return parent::connect(
@@ -117,7 +122,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
// Make sure we're properly connected
if (! $this->socket) {
- require_once 'Zend/Http/Client/Adapter/Exception.php';
+ // require_once 'Zend/Http/Client/Adapter/Exception.php';
throw new Zend_Http_Client_Adapter_Exception("Trying to write but we are not connected");
}
@@ -125,7 +130,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
$port = $this->config['proxy_port'];
if ($this->connected_to[0] != "tcp://$host" || $this->connected_to[1] != $port) {
- require_once 'Zend/Http/Client/Adapter/Exception.php';
+ // require_once 'Zend/Http/Client/Adapter/Exception.php';
throw new Zend_Http_Client_Adapter_Exception("Trying to write but we are connected to the wrong proxy server");
}
@@ -167,7 +172,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
// Send the request
if (! @fwrite($this->socket, $request)) {
- require_once 'Zend/Http/Client/Adapter/Exception.php';
+ // require_once 'Zend/Http/Client/Adapter/Exception.php';
throw new Zend_Http_Client_Adapter_Exception("Error writing request to proxy server");
}
@@ -203,7 +208,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
// Send the request
if (! @fwrite($this->socket, $request)) {
- require_once 'Zend/Http/Client/Adapter/Exception.php';
+ // require_once 'Zend/Http/Client/Adapter/Exception.php';
throw new Zend_Http_Client_Adapter_Exception("Error writing request to proxy server");
}
@@ -220,7 +225,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
// Check that the response from the proxy is 200
if (Zend_Http_Response::extractCode($response) != 200) {
- require_once 'Zend/Http/Client/Adapter/Exception.php';
+ // require_once 'Zend/Http/Client/Adapter/Exception.php';
throw new Zend_Http_Client_Adapter_Exception("Unable to connect to HTTPS proxy. Server response: " . $response);
}
@@ -240,7 +245,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
}
if (! $success) {
- require_once 'Zend/Http/Client/Adapter/Exception.php';
+ // require_once 'Zend/Http/Client/Adapter/Exception.php';
throw new Zend_Http_Client_Adapter_Exception("Unable to connect to" .
" HTTPS server through proxy: could not negotiate secure connection.");
}