[RavenDB] Exception Details: System.IO.IOException: The handshake failed due to an unexpected packet format.

917 views
Skip to first unread message

Ryan Heath

unread,
Mar 10, 2012, 3:59:15 PM3/10/12
to rav...@googlegroups.com
I am trying to reach the ravenhq from a hosting webserver but got this error:

Exception Details: System.IO.IOException: The handshake failed due to
an unexpected packet format.

Anyone an idea what is going on? I can connect to ravenhq perfectly
from my dev machine.

// Ryan

The relevant stack trace:
[IOException: The handshake failed due to an unexpected packet format.]
System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32
readBytes, AsyncProtocolRequest asyncRequest) +6153260
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
AsyncProtocolRequest asyncRequest) +85
System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken
message, AsyncProtocolRequest asyncRequest) +61
System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32
count, AsyncProtocolRequest asyncRequest) +137
System.Net.Security.SslState.ForceAuthentication(Boolean
receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) +143
System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
lazyResult) +99
System.Net.TlsStream.CallProcessAuthentication(Object state) +47
System.Threading.ExecutionContext.runTryCode(Object userData) +80
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData) +0
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state) +105
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx) +125
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) +43
System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) +798
System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) +58
System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) +26
System.Net.ConnectStream.WriteHeaders(Boolean async) +139

[WebException: The underlying connection was closed: An unexpected
error occurred on a send.]
System.Net.HttpWebRequest.GetResponse() +6111651
Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func`1
getResponse) in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:281
Raven.Client.Connection.HttpJsonRequest.ReadResponseString() in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:205
Raven.Client.Connection.HttpJsonRequest.ReadResponseJson() in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:616
Raven.Client.Connection.ServerClient.DirectQuery(String index,
IndexQuery query, String operationUrl, String[] includes) in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:711
Raven.Client.Connection.<>c__DisplayClass37.<Query>b__36(String u)
in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:683
Raven.Client.Connection.ServerClient.TryOperation(Func`2 operation,
String operationUrl, Boolean avoidThrowing, T& result) in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:208
Raven.Client.Connection.ServerClient.ExecuteWithReplication(String
method, Func`2 operation) in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:173
Raven.Client.Connection.ServerClient.Query(String index, IndexQuery
query, String[] includes) in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:683
Raven.Client.Document.AbstractDocumentQuery`2.ExecuteActualQuery()
in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\AbstractDocumentQuery.cs:426
Raven.Client.Document.AbstractDocumentQuery`2.InitSync() in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\AbstractDocumentQuery.cs:415
Raven.Client.Document.AbstractDocumentQuery`2.GetEnumerator() in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\AbstractDocumentQuery.cs:562
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +182
Raven.Client.Linq.RavenQueryProviderProcessor`1.GetQueryResult(IDocumentQuery`1
finalQuery) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\RavenQueryProviderProcessor.cs:1252
Raven.Client.Linq.RavenQueryProviderProcessor`1.ExecuteQuery() in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\RavenQueryProviderProcessor.cs:1194
Raven.Client.Linq.RavenQueryProviderProcessor`1.Execute(Expression
expression) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\RavenQueryProviderProcessor.cs:1177
Raven.Client.Linq.DynamicRavenQueryProvider`1.Execute(Expression
expression) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\DynamicRavenQueryProvider.cs:173
Raven.Client.Linq.DynamicRavenQueryProvider`1.System.Linq.IQueryProvider.Execute(Expression
expression) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\DynamicRavenQueryProvider.cs:224
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +265

Oren Eini (Ayende Rahien)

unread,
Mar 11, 2012, 6:22:02 AM3/11/12
to rav...@googlegroups.com
I have never seen that happen in HTTPS, but it looks like there is something corrupting the HTTPS stream.
Do you have a router or a proxy that might be doing that?
Can you try from another location?

Ryan Heath

unread,
Mar 27, 2012, 6:10:01 AM3/27/12
to rav...@googlegroups.com
Is there any chance there is something about https://1.ravenhq.com/ certificate?
The provider has not been able to fix it yet. The strange thing is
that they can reach https://ravenhq.com/ but not
https://1.ravenhq.com/
As far as I can see those address issue the same certificates?

Mind, I have been able to connect to https://1.ravenhq.com/ and
https://ravenhq.com/ flawlessly from different computers and networks
...

// Ryan

Oren Eini (Ayende Rahien)

unread,
Mar 27, 2012, 6:15:21 AM3/27/12
to rav...@googlegroups.com
The cert is valid, I just double checked it. 

Ryan Heath

unread,
Mar 27, 2012, 6:31:30 AM3/27/12
to rav...@googlegroups.com
Yep, thats what I said to them ...
But still it's intriguing what's going on. Via one address the
certificate seems valid, but via another address the same certificate
seems invalid, while the certificate is issued for both addresses ...
Very weird.

// Ryan

On Tue, Mar 27, 2012 at 12:15 PM, Oren Eini (Ayende Rahien)

Reply all
Reply to author
Forward
0 new messages