diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-23 07:45:36 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-23 07:45:36 +0400 |
commit | 7e1b5d6b762340cbff1bb928d15815980c7649a7 (patch) | |
tree | e07da179b9e1372866d2349777bd1cc6b4c9e8cf /libs/Zend/Http/Client/Adapter/Proxy.php | |
parent | 999f46479294713104c962bfe7469e9b6e7a4bbf (diff) | |
parent | c98ea06f2cccec81c6ccce49162a583494e44d91 (diff) |
Diffstat (limited to 'libs/Zend/Http/Client/Adapter/Proxy.php')
-rw-r--r-- | libs/Zend/Http/Client/Adapter/Proxy.php | 29 |
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."); } |