Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Closed Issue: Invalid handling of http proxy server response [1509]

$
0
0
Hi,

I did find a problem when testing the assembly with our squid 3.0 proxy. I receive the message, that Result cannot be called on a failed match. Therefore I've extended the code in Session.cs a little bit:

if (statusCode == 200 && string.IsNullOrEmpty(response))
{
// Once all HTTP header information is read, exit
break;
}
else
{
string reasonPhrase = string.Empty;

try
{
if (match.Success)
reasonPhrase = match.Result("${reasonPhrase}");
}
catch (Exception ex)
{
reasonPhrase = string.Empty;
}

Now the following line

throw new ProxyException(string.Format("HTTP: Status code {0}, Reason \"{1}\"", statusCode, reasonPhrase));

Does at least return the error code (not yet the fault reason; in this case ERR_ACCESS_DENIED)

In fact the code received a 403 status code from the proxy:

SshNet.Logging Verbose: 1 : Initiating connect to 'yyy.xxx.zzz.ww:22'.

HTTP/1.0 403 Forbidden
Server: squid/3.0.STABLE16-RC1
Mime-Version: 1.0
Date: Wed, 13 Feb 2013 14:15:06 GMT
Content-Type: text/html
Content-Length: 1008
Expires: Wed, 13 Feb 2013 14:15:06 GMT
X-Squid-Error: ERR_ACCESS_DENIED 0
X-Cache: MISS from app-proxy-3.xxxx.xxx
Via: 1.0 app-proxy-3.xxxx.xxx (squid/3.0.STABLE16-RC1)
Proxy-Connection: close

The thread 0xa2c has exited with code 0 (0x0).

Kind regards

Johannes

Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>