HTTPS POST returning 100 Continue makes the WebClient throw protocol violation exception [modified]
-
Hi, I use a WebClient to post some data to a server. (.Net 2.0) The server returns back: HTTP/1.1 100 Continue Server: Microsoft-IIS/5.0 Date: … HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Content-Type: text/xml;charset=ISO-8859-1 Content-Length: 929 This is valid as per the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html[^] As per the http specs this is a valid way of returning content and is generally used when the server requires more time to process and sends you a 100 Continue. However from .Net I get the exception: The server committed a protocol violation. Section=ResponseStatusLine While processing the response. This seems to because the space in the headers is considered a possible security issue. This is a bit of chicken and the egg. Header splitting is a security issue however 100 Continue + header splitting is valid as per the specs. http://www.dotnet247.com/247reference/msgs/57/289086.aspx[^] Now reading a bit more I found this nice comment on an MSDN blog: http://blogs.msdn.com/david.wang/archive/2006/04/05/HTTP-SYS-IIS-and-the-100-continue.aspx[^] Clients which advertise to be HTTP/1.1 compliant and then crash on "100 continue" are the real problem (they are not following public specifications) The “fix” is to add a setting in the web config to disable the checking of split headers: [...] httpWebRequest useUnsafeHeaderParsing="true" [...] My problem is that Setting the flag in the config does not make any difference. Setting the flag using reflection does not help either. I still get the exception. Setting the Enable100Continue property on the ServicePointManager or ServicePoint does not help either. I still get the exception. Any help is welcome. Thanks, Corneliu. -- modified at 19:17 Sunday 25th February, 2007
My.Team www.re