Select the product you need help with
You receive one or more error messages when you try to make an HTTP request in an application that is built on the .NET Framework 1.1 Service Pack 1Article ID: 915599 - View products that this article applies to. On This PageSUMMARYThis article describes error messages that you may receive when you use the Microsoft .NET Framework 1.1 Service Pack 1 (SP1) to make HTTP requests or when you call a Web service. SYMPTOMS When you try to make an HTTP request in an application that
is built on the .NET Framework, you may receive one or more of the following
error messages: Error message 1 The underlying connection was closed: Unable
to connect to the remote server. Error message 2 The underlying connection was closed: An
unexpected error occurred on a send. Error message 3 The underlying connection was closed: An
unexpected error occurred on a receive. Error message 4 The underlying connection was closed: The
server committed an HTTP protocol violation. Error message 5 The underlying connection was closed: Could
not establish secure channel for SSL/TLS. Error message 6 The operation has
timed-out CAUSEError message 1This problem occurs when the .NET Framework cannot establish a connection to the remote server. This problem may occur when one or more of the following conditions are true:
Error message 2This problem occurs when the client computer cannot send an HTTP request. The client computer cannot send the HTTP request because the connection has been closed or is unavailable. This problem may occur when the client computer is sending lots of data. To resolve this problem, see resolutions A, D, E, F, and O.Error message 3This problem occurs when the server or another network device unexpectedly closes an existing Transmission Control Protocol (TCP) connection. This problem may occur when a time-out value on the server or on the network device is set too low. To resolve this problem, see resolutions A, D, E, F, and O. The problem can also occur if the server resets the connection unexpectedly, such as if an unhandled exception crashes the server process. Analyze the server logs to see if this may be the issue.Error message 4This problem occurs when the .NET Framework detects that the server response does not comply with HTTP 1.1 RFC. This problem may occur when the response contains incorrect headers or incorrect header delimiters. To resolve this problem, see resolutions A and G.For more information about HTTP headers, visit the following World Wide Web Consortium Web site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6 Microsoft
provides third-party contact information to help you find technical support.
This contact information may change without notice. Microsoft does not
guarantee the accuracy of this third-party contact information.
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6)
Error message 5This problem may occur when one or more of the following conditions are true:
Error message 6This problem occurs when the client time-out value is reached before one of the following conditions occurs:
RESOLUTIONNote The following list contains possible resolutions that may apply
when one of these problems occurs. Not all these resolutions apply to all these
problems. See the problem descriptions in the "Cause" section to determine
which resolution applies. Resolution ATo resolve this problem, make sure that you are using the most recent version of the .NET Framework. For more information, click the following article number to view the article in the Microsoft Knowledge Base:318785
(http://support.microsoft.com/kb/318785/
)
How to determine which versions of the .NET Framework are installed and whether service packs have been applied
Resolution BTo resolve this problem, make sure that the proxy settings are correct. To do this, use the following techniques:
Resolution CTo resolve this problem, make sure that the application has permissions to make network calls and to make socket calls. This resolution applies when the application that makes the HttpWebRequest call runs inside a Web application. You may have to grant Read permissions to the ASPNET account so that you can access the following resources:
http://technet.microsoft.com/en-us/sysinternals/default.aspx The
third-party products that this article discusses are manufactured by companies
that are independent of Microsoft. Microsoft makes no warranty, implied or
otherwise, regarding the performance or reliability of these products.
(http://technet.microsoft.com/en-us/sysinternals/default.aspx)
Resolution DTo resolve this problem, disable the keep-alive feature. In the .NET Framework, set the HttpWebRequest.KeepAlive property to FALSE. To do this when you call a Web service, follow these steps.Note The keep-alive feature is required for NTLM authentication.
Resolution ETo resolve this problem, set the ServicePointManager.MaxServicePointIdleTime property to less than the time-out value of the server keep-alive connection.Notes
Resolution FTo resolve this problem, increase the time-out value on the server computer and on other network devices. To increase the time-out value in Microsoft Internet Information Services (IIS) 6.0, follow these steps:
Resolution GTo work around this problem, set useUnsafeHeaderParsing to True. For more information about the useUnsafeHeaderParsing property, click the following article number to view the article in the Microsoft Knowledge Base:888528
(http://support.microsoft.com/kb/888528/
)
A list of the bugs that are fixed in the .NET Framework 1.1 Service Pack 1 but are not described elsewhere in individual Microsoft Knowledge Base articles
Resolution HTo resolve this problem, supply a valid client certificate for the application. For more information about how to use client certificates, click the following article numbers to view the articles in the Microsoft Knowledge Base:901183
(http://support.microsoft.com/kb/901183/
)
How to call a Web service by using a client certificate for authentication in an ASP.NET Web application
895971
(http://support.microsoft.com/kb/895971/
)
How to send a client certificate by using the HttpWebRequest and HttpWebResponse classes in Microsoft Visual C# .NET
Resolution ITo resolve this problem, supply a valid security certificate for the server. Additionally, you may be able to resolve this problem by installing the root certification authority (CA) certificate or by correcting the common name of the server certificate. For more information about naming the server certificate, click the following article number to view the article in the Microsoft Knowledge Base:813618 Warning This workaround may make your computer or your network more
vulnerable to attack by malicious users or by malicious software such as
viruses. We do not recommend this workaround but are providing this information
so that you can implement this workaround at your own discretion. Use this
workaround at your own risk.
(http://support.microsoft.com/kb/813618/
)
Security alert: The name of the security certificate is invalid or does not match the name of the site
You can also revise the application code to ignore these certificate warnings. To do this, implement your own ICertificatePolicy interface. You can then set the ServicePointManager.CertificatePolicy property to use your certificate policy instance before the Web service method call is made. Note The ICertificatePolicy.CheckValidationResult method implements the application certificate validation policy. For more information about the ICertificatePolicy.CheckValidationResult method, visit the following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/system.net.icertificatepolicy.checkvalidationresult(vs.71).aspx
For more information and a code sample, click the following article number to
view the article in the Microsoft Knowledge Base:
(http://msdn2.microsoft.com/en-us/library/system.net.icertificatepolicy.checkvalidationresult(vs.71).aspx)
823177 Important We recommend that you not ignore SSL certificate warnings in code
because of possible security risks.
(http://support.microsoft.com/kb/823177/
)
PRB: "System.Net.WebException. The underlying connection was closed. Could not establish trust relationship with remote server" error message when you upgrade the .NET Framework
Resolution JTo resolve this problem, change the HTTPS protocol from SSL to Transport Level Security (TLS).Note If you already use TLS, change the HTTPS protocol to SSL. To change the HTTPS protocol on the client computer, see the "ServicePointManager.SecurityProtocol property" section on the following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol.aspx Note For example, to support the SSL3 protocol and the TLS1 protocol,
use code that is similar to the following.
(http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol.aspx)
187498
(http://support.microsoft.com/kb/187498/
)
How to disable PCT 1.0, SSL 2.0, SSL 3.0, or TLS 1.0 in Internet Information Services
Resolution KTo resolve this problem, increase the value of the maxConnection property. To do this, revise the configuration files for the application or add application code.Note The default value of the maxConnection property is 2. For Microsoft ASP.NET-connected applications that call Web services, we recommend that you set a value of 12 times the number of processors. To set this value by using application code, use the ServicePointManager.DefaultConnectionLimit property. For more information about the ServicePointManager.DefaultConnectionLimit property, visit the following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit(vs.71).aspx To set this value by using the configuration files for the
application, add the following code to the configuration file.
(http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.defaultconnectionlimit(vs.71).aspx)
http://msdn2.microsoft.com/en-us/library/aa903351(VS.71).aspx
(http://msdn2.microsoft.com/en-us/library/aa903351(VS.71).aspx)
Resolution LTo resolve this problem, make sure that the time-out settings on the server and on other network devices are implemented correctly. For more information about how to implement time-out settings, click the following article number to view the article in the Microsoft Knowledge Base:904262
(http://support.microsoft.com/kb/904262/
)
The request that is sent by the HttpWebRequest class may stop responding when you use the HttpWebRequest class in an ASP.NET application
Resolution MTo resolve this problem, read about ASP.NET performance tuning. For more information about ASP.NET performance tuning, click the following article number to view the article in the Microsoft Knowledge Base:821268
(http://support.microsoft.com/kb/821268/
)
Contention, poor performance, and deadlocks when you make Web service requests from ASP.NET applications
Resolution NTo resolve this problem, increase the values of the time-out properties in the client application code. To do this, use the following properties:
http://msdn2.microsoft.com/en-us/library/cy9yd268.aspx For more information about the HttpWebRequest.ReadWriteTimeout property, visit the following Microsoft Web site:
(http://msdn2.microsoft.com/en-us/library/cy9yd268.aspx)
http://msdn2.microsoft.com/en-us/library/b1w9c0s4.aspx
(http://msdn2.microsoft.com/en-us/library/b1w9c0s4.aspx)
Resolution OTo resolve this problem, make sure that the client computer does not send the HTTP 100-Continue header. Additionally, make sure that the client computer does not expect to receive the HTTP 100-Continue header.Note This resolution is effective if the Web server or the proxy server does not support the HTTP 100-Continue header. For more information about how to disable the HTTP 100-Continue header for the client computer, visit the following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue.aspx
(http://msdn2.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue.aspx)
REFERENCESFor more information about performance considerations when
you make Web service calls from ASP.NET-connected applications, visit the
following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/aa480507.aspx For more information about
performance issues and deadlock issues when you make Web service requests from
ASP.NET-connected applications, click the following article number to view the
article in the Microsoft Knowledge Base:
(http://msdn2.microsoft.com/en-us/library/aa480507.aspx)
821268 For more information about how to improve the
performance of ASP.NET-connected applications, visit the following Microsoft
Web site:
(http://support.microsoft.com/kb/821268/
)
Contention, poor performance, and deadlocks when you make Web service requests from ASP.NET applications
http://msdn2.microsoft.com/en-us/library/ms998549.aspx For more information about how to improve the performance of Web
services, visit the following Microsoft Web site:
(http://msdn2.microsoft.com/en-us/library/ms998549.aspx)
http://msdn2.microsoft.com/en-us/library/ms998562.aspx For more information about how to build secure ASP.NET-connected
applications, visit the following Microsoft Web site:
(http://msdn2.microsoft.com/en-us/library/ms998562.aspx)
http://msdn2.microsoft.com/en-us/library/aa302408.aspx Note The TCP transport protocol is used for HTTP requests. TCP is a
reliable, connection-oriented protocol. However, if a TCP connection closes
unexpectedly, the application retries the request. For more information about
the TCP protocol and about client behavior if the server closes a connection,
visit the following World Wide Web Consortium Web site:
(http://msdn2.microsoft.com/en-us/library/aa302408.aspx)
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.4 Microsoft
provides third-party contact information to help you find technical support.
This contact information may change without notice. Microsoft does not
guarantee the accuracy of this third-party contact information.
For more information about the FileMon utility
and the RegMon utility, click the following article number to view the article
in the Microsoft Knowledge Base:
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.4)
198038 For
more information about Network Monitor, click the following article numbers to
view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/198038/
)
Useful tools for package and deployment issues
148942
(http://support.microsoft.com/kb/148942/
)
How to capture network traffic with Network Monitor
812953
(http://support.microsoft.com/kb/812953/
)
How to use Network Monitor to capture network traffic
PropertiesArticle ID: 915599 - Last Review: September 28, 2011 - Revision: 3.0
|


Back to the top








