Understanding HttpWebRequest Connection Management and ServicepointManager

If you are looking for some information on understanding the basics of HttpWebRequest connection management and servicepointmanager, I just posted an article which could be useful for you.


This is first in the series, in future posting I promise to provide more details about specific scenarios which include Http with authentication and proxy server and also for other protocols like FtpWebRequest and SmtpClient, which were added in .net frameworks 2.0.

Comments (6)
  1. Hi

    I’m using HttpWebRequest to SSL url (in the internet) and sometimes get the following error:

    "The underlying connection

    was closed: Could not establish secure channel for SSL/TLS".

    It is asp.net application and runs under asp.net user. Sometimes it uses impersonation when it has to deal with active directory on the local network. What may be the cause of the problem, what do you think ?

  2. adarshk says:

    Hi Anatoly,

    send me message with your email address and contains details of your problem, the problem you did send earlier did not have sufficient information to respond.

    The question did not have enough data, tell me which server you are making request. Most probable cause I can guess (only guess, there might be other reasons too) is server certificate validation error which could be resolved with implementing custom ICertificatePolicy.

  3. Hi Adarsh

    The issue is solved and I answered you here:


    Sorry for misunderstanding.

    Thanks anyway 🙂

  4. Amol says:

    Hi ,

    I m sending httpwebrequest request to one webservice. but it always fails first time. Second time onwards it starts working when I impelmented sessions. Why request is failing first time?

Comments are closed.

Skip to main content