D
DL
I'm trying to create a program to auto-reboot my netgear router when
my wireless connection goes down. I have no control over the
webserver installed on this machine (which is apparently violating the
HTTP protocol standard). I cannot snoop packets on this HTTP
connection because it forces an SSL-encrypted connection. I have
already made the config file change useUnsafeHeaderParsing="true",
which does not change the error message. (I also tried changing other
things in the config file to make sure it was being read).
Basically, I try to connect and I get the message "The underlying
connection was closed: The server commit
ted an HTTP protocol violation." What is odd is that I can connect
and pull down the main index page fine, but when I try to access the
login page, I get the error.
If anyone has any other thoughts besides the useUnsafeHeaderParsing
option, it would be greatly appreciated.
-DL
Here is my code:
// open new web client
WebClient client = new WebClient();
try
{
Stream data =
client.OpenRead("https://192.168.x.x/login.tri");
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
Console.WriteLine(s);
data.Close();
reader.Close();
}
catch (WebException ex)
{
Console.WriteLine(client.ResponseHeaders);
Console.WriteLine(ex.ToString());
}
And the error message:
System.Net.WebException: The underlying connection was closed: The
server commit
ted an HTTP protocol violation.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.OpenRead(String address)
at ping.Program.Main(String[] args)
System.Net.WebException: The underlying connection was closed: The
server commit
ted an HTTP protocol violation.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.OpenRead(String address)
at ping.Program.Main(String[] args)
my wireless connection goes down. I have no control over the
webserver installed on this machine (which is apparently violating the
HTTP protocol standard). I cannot snoop packets on this HTTP
connection because it forces an SSL-encrypted connection. I have
already made the config file change useUnsafeHeaderParsing="true",
which does not change the error message. (I also tried changing other
things in the config file to make sure it was being read).
Basically, I try to connect and I get the message "The underlying
connection was closed: The server commit
ted an HTTP protocol violation." What is odd is that I can connect
and pull down the main index page fine, but when I try to access the
login page, I get the error.
If anyone has any other thoughts besides the useUnsafeHeaderParsing
option, it would be greatly appreciated.
-DL
Here is my code:
// open new web client
WebClient client = new WebClient();
try
{
Stream data =
client.OpenRead("https://192.168.x.x/login.tri");
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
Console.WriteLine(s);
data.Close();
reader.Close();
}
catch (WebException ex)
{
Console.WriteLine(client.ResponseHeaders);
Console.WriteLine(ex.ToString());
}
And the error message:
System.Net.WebException: The underlying connection was closed: The
server commit
ted an HTTP protocol violation.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.OpenRead(String address)
at ping.Program.Main(String[] args)
System.Net.WebException: The underlying connection was closed: The
server commit
ted an HTTP protocol violation.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.OpenRead(String address)
at ping.Program.Main(String[] args)