while ($line = @
fgets($this->socket
)) { $gotStatus =
$gotStatus || (strpos($line, 'HTTP'
) !== false
);
if ($gotStatus) { $response .=
$line;
if (!
chop($line)) { break;
} } } // Check that the response from the proxy is 200
if (Zend_Http_Response::
extractCode($response) != 200
) { throw new Zend_Http_Client_Adapter_Exception( 'Unable to connect to HTTPS proxy. Server response: ' .
$response );
} // If all is good, switch socket to secure mode. We have to fall back
// through the different modes
$modes = array
( STREAM_CRYPTO_METHOD_TLS_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,