473,569 Members | 2,522 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
connection.
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
connection.
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
size)
at NASDTrace.MyHtt pResource.GetFi le()

Thanks in advance.
Dhina

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

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

For details, see the link
http://haacked.com/archive/2004/05/15/449.aspx

Thanks
Dhina

Nov 17 '05 #2

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

Similar topics

0
1208
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...
16
4184
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.
1
3524
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...
3
2392
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...
5
3546
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...
5
15704
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...
0
789
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
3
14039
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
0
5069
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-09.45.34.366406+420 I306667A443 LEVEL: Warning PID : 835622 TID : 1 PROC : db2stmm (WEBEDIDB) INSTANCE: db2inst1 NODE : 000 DB : WEBEDIDB APPHDL : 0-8 ...
0
7701
marktang
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...
0
7615
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...
0
7924
Oralloy
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. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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...
0
7979
tracyyun
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...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
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
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.