473,698 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to write data to remote HTTPS server

Hi All,
I am getting lot of
System.IO.IOExc eption: Unable to write data to the transport
exceptions when I write to a Stream which is connected to a Remote
HTTPS server using a proxy and a certificate.

ASCIIEncoding encoding = new ASCIIEncoding() ;
byte[] data = encoding.GetByt es(..........);

HttpWebRequest req = (HttpWebRequest ) WebRequest.Crea te(m_url);
req.Method = "POST";
req.ContentType = "applicatio n/x-www-form-urlencoded";
req.ContentLeng th = data.Length;
req.Proxy = new WebProxy( ...........);
req.Credentials = new NetworkCredenti al(..........);
req.ClientCerti ficates.Add(... .....);

Stream reqStream = req.GetRequestS tream();
reqStream.Write (data, 0, data.Length); // THROWS IOException here

The exception is thrown in almost 50% of the write request throughout
the day. Here is the exception I get.

System.IO.IOExc eption: Unable to write data to the transport
at System.Net.TlsS tream.InnerWrit e(Boolean async, Byte[] buffer,
Int32 offset
, Int32 size, AsyncCallback asyncCallback, Object asyncState)
at System.Net.TlsS tream.BeginWrit e(Byte[] buffer, Int32 offset,
Int32 size, A
syncCallback asyncCallback, Object asyncState)
at System.Net.Conn ection.BeginWri te(Byte[] buffer, Int32 offset,
Int32 size,
AsyncCallback callback, Object state)
at System.Net.Conn ectStream.Begin Write(Byte[] buffer, Int32 offset,
Int32 siz
e, AsyncCallback callback, Object state)
at System.Net.Conn ectStream.Write (Byte[] buffer, Int32 offset, Int32
at NASDTrace.MyHtt pResource.GetFi le()

Thanks in advance.

Nov 17 '05 #1
1 2420
I fixed it by adding a line of code.

System.Net.Serv icePointManager .Expect100Conti nue = false;

For details, see the link


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: SleepingRabbit | last post by:
Hi All, I am new to web service client development. Grateful, if anybody can help me to solve this issue. Or let me know where/what I have done wrong. We are to consume a webservice (from a different company). It requires digital certification, SSL enabling and cookies acceptance. The web service is also not on the default port. When trying to obtain the stub class for the service, I could not get the
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the remote site is trusted. Also, my web site uses a custom HTTPModule implemented in a DLL named Security.dll. Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll. Description: An unhandled exception occurred during...
by: purkka | last post by:
Hi I replaced a Win 2000 Adv server to the Win 2003 Std with Front Page Server Extension and .Net Framework 2.0. FPSE is extended to Default Web Site. Visual Studio 2005: If I create a new web by VS2005 installed on my server, no problem, but if i try to do same remotely using http, I got "Unable to create the Web 'http://computer.aaa.com/MySite'. You are not authorized to perform the current operation."
by: Charlie King | last post by:
I'm trying to send data to a remote script (a credit card processing third party) from my site using POST. Currently, I'm doing it using the ususal form dynamically built with my values. This is less than ideal because I want to perform local processing (updating order status in the local database) and then to proceed to the remote script, with resultant values, without relying on the user pressing a button.
by: Arno | last post by:
reposted with the right microsoft managed newsgroup ID: Sorry for the inconvinience Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with socket.BeginRead in the Sub SocketIncomingMsg. I'm debugging now for weeks, but I can't detect where it's
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
by: nimjerry | last post by:
i am using db2 udb V 9 on aix 5.3 and in db2diag.log alwas has this error occurr below is sample message 2008-03-03- I306667A443 LEVEL: Warning PID : 835622 TID : 1 PROC : db2stmm (WEBEDIDB) INSTANCE: db2inst1 NODE : 000 DB : WEBEDIDB APPHDL : 0-8 APPID: *LOCAL.db2inst1.080229022428 AUTHID : DB2INST1 FUNCTION: DB2 UDB, Self tuning memory...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.