The handshake failed due to an unexpected packet format

825 views
Skip to first unread message

Zhucheng Jin

unread,
Oct 14, 2016, 7:28:09 PM10/14/16
to Particular Software
Hello All,

we have NServiceBus installed on premises and developed a Saga which publishes messages to Azure Service Bus.  We tested with different scenarios on our laptops, and it works fine.  However after deploying to the client envinment, we got an error - The handshake failed due to an unexpected packet format.  I also attached stack trace below.

what could cause the issue?  we are thinking to try with ConnectivityMode to be http/https and TransportType to be amqp but how could set those two values?

thanks,

2016-10-14 11:19:00.555 DEBUG NServiceBus.SerializeMessageConnector Serializing message 'M.Msg.Sagas.Scheduling.StartLoadScheduling, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with id 'd927b20f-f9ba-4a92-a922-a69f00bb6', ToString() of the message yields: M.Msg.Sagas.Scheduling.StartLoadScheduling 

2016-10-14 11:19:00.971 DEBUG NServiceBus.RoutingToDispatchConnector Destination: JobPublisher
Message headers:
NServiceBus.MessageId:d927b20f-f9ba-4a92-a922-a69f00ba7eb6, NServiceBus.MessageIntent:Send, NServiceBus.CorrelationId:d927bf-f9ba-4a92-a922-a69f00ba7eb6, NServiceBus.OriginatingMachine:, NServiceBus.OriginatingEndpoint:JobPublisher, $.diagnostics.originating.hostid:c8fc803d589b8e156a5de3c8d61951, NServiceBus.ReplyToAddress:JobPublisher, NServiceBus.ContentType:application/json, NServiceBus.EnclosedMessageTypes:M.Msg.Sagas.Scheduling.StartLoadScheduling, Monitronics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, NServiceBus.ConversationId:8b67e86a-20ee-42af-90ad-a690ba7f49, NServiceBus.Version:6.0.0, NServiceBus.TimeSent:2016-10-14 16:19:00:951339 Z
2016-10-14 11:19:01.011 DEBUG NServiceBus.Transport.AzureServiceBus.DefaultOutgoingBatchRouter Routing 1 messages to JobPublisher
2016-10-14 11:19:02.347 DEBUG NServiceBus.Transport.AzureServiceBus.DefaultOutgoingBatchRouter Routing batched messages, chunk #1.
2016-10-14 11:19:03.611 ERROR NServiceBus.StartableEndpoint Receiver Main failed to start.
Microsoft.ServiceBus.Messaging.MessagingCommunicationException: Transport security negotiation failed due to an underlying IO error: The handshake failed due to an unexpected packet format.. ---> System.ServiceModel.Security.SecurityNegotiationException: Transport security negotiation failed due to an underlying IO error: The handshake failed due to an unexpected packet format.. ---> System.IO.IOException: The handshake failed due to an unexpected packet format.
   at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
   at System.ServiceModel.Channels.SslStreamSecurityUpgradeInitiator.InitiateUpgradeAsyncResult.OnCompleteAuthenticateAsClient(IAsyncResult result)
   at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorAsyncResult.CompleteAuthenticateAsClient(IAsyncResult result)
   --- End of inner exception stack trace ---




Zhucheng Jin

unread,
Oct 14, 2016, 7:28:14 PM10/14/16
to Particular Software
Helpful information to include
Product name:NServiceBus
Version:6
Stacktrace:
Description:

We have NServiceBus installed on premises and publish messages to Azure Service Bus.  The code is developed on version 6.  We tested on our laptops and are able to publish messages to Azure Service Bus.  However after we deployed the code to the client environment, we got this error - The handshake failed due to an unexpected packet format.  please also see the stack trace below

what could cause the issue?

we are thinking to try with ConnectivityMode to be http/https and TransportType to be amqp, but how could we set them up  either in code or in config file?

Sean Feldman

unread,
Oct 15, 2016, 3:41:31 AM10/15/16
to Particular Software
Hi Zhucheng,

This is probably network issue with TCP ports needed by ASB. By default, ConnectivityMode is TCP.
To change the connectivity mode and transport type, see documentation here: https://docs.particular.net/nservicebus/azure-service-bus/configuration/full#controlling-connectivity

All transport related configuration are performed on the transport object. See documentation here on how endpoint configuration is used here: https://docs.particular.net/nservicebus/azure-service-bus/configuration/

Sean Feldman

unread,
Oct 15, 2016, 3:44:39 AM10/15/16
to Particular Software
In regards to the transport type, note that SendsAtomicWithReceive transport transaction mode in only supported with NetMessaging, not AMQP.
Reply all
Reply to author
Forward
0 new messages