Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. HTTPS POST returning 100 Continue makes the WebClient throw protocol violation exception [modified]

HTTPS POST returning 100 Continue makes the WebClient throw protocol violation exception [modified]

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharphtmlcomsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Corneliu Tusnea
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups