While calling a 3rd party webservice with client certificate i'm getting a message 'The message received was unexpected or badly formatted ' .
The message received was unexpected or badly formatted Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted Source Error: Line 58: postStream.Close(); Line 59: } Line 60: HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Line 61: if (response.StatusCode == HttpStatusCode.OK) Line 62: { Source File: D:\Projects\Algo POC\AlgoParsing\Sample.aspx.cs Line: 60 Stack Trace: [Win32Exception (0x80004005): The message received was unexpected or badly formatted] [IOException: The decryption operation failed, see inner exception.] System.Net.Security._SslStream.ProcessReadErrorCode(SecurityStatus errorCode, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest, Byte[] extraBuffer) +1445512 System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +5341698 System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +201 System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +169 System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +144 System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) +319 System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size) +162 System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) +26 System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) +297 [WebException: The underlying connection was closed: An unexpected error occurred on a receive.] System.Net.HttpWebRequest.GetResponse() +5373789 AlgoParsing.Sample.WRequest(String URL, String method, String postData) in D:\Projects\Algo POC\AlgoParsing\Sample.aspx.cs:60 AlgoParsing.Sample.Page_Load(Object sender, EventArgs e) in D:\Projects\Algo POC\AlgoParsing\Sample.aspx.cs:28 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
November 17th, 2010 10:39am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics