By TheLearner

2011-03-03 09:21:56 8 Comments

Does anyone know what this means?

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: The handshake failed due to an unexpected packet format. at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.TlsStream.CallProcessAuthentication(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.WriteHeaders(Boolean async) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at


This is the method I was calling:

_productsService = new ProductsPortTypeClient(); _productsService.GetResortProducts(GetProductsCredentials(), GetResortProductParams());


@juFo 2018-03-15 16:11:22

summary: wrong port was used.

My service was running in development on port :58328 but next time I debugged it was running on port :44315, and this caused the issue. So changing the port on the client side to 44315 helped to resolve the issue!

@Ludwo 2016-06-03 09:27:46

In my case it was Skype blocking 443 port. Go to Skype tools-advanced-connections and disable "Use port 80 & 443 for connections..."

@EricRRichards 2016-08-15 14:23:28

Ugh, that is some irritating Skype behavior. I can't count the number of times I've had to use Skype for a conference call and forgot I left it running, then started to tear my hair out why the web server application I was working on wouldn't start up.

@Tobiasz 2011-03-03 10:46:46

It looks like a problem with SSL authentication, it fails at handshake phase, maybe two implementations are not compatible, you may check the WSDL format of the response, figure out what format should be used for communication and check if the one sent by you complies with it (you may use any kind of a network monitor software, eg. Microsoft Network Monitor)

Related Questions

Sponsored Content

1 Answered Questions

WCF Rest making a http request: sequence closed due to authentication error

  • 2017-12-01 06:32:20
  • samuel Sai
  • 40 View
  • 0 Score
  • 1 Answer
  • Tags:   c# .net rest api wcf

0 Answered Questions

1 Answered Questions

SSL connection error

0 Answered Questions

PowerShell + HttpWebRequest throws exception

2 Answered Questions

[SOLVED] Accessing Webservice which is hosted on https server

1 Answered Questions

How do access a secure website within a sharepoint webpart?

Sponsored Content