Search code examples
botframeworkalexa-skills-kitdirect-line-botframework

Why does connection get closed when using DirectLine v3 Client (Microsoft Bot Connector)


I have setup a custom service to connect my Alexa Skill with my Chatbot via DirectLine. Last thursday everything worked fine and I was able to send messages to my Bot by using Alexa (Developer Test tool) and also received responses from my Chatbot.

Now I wanted to continue my development but everytime i want to start my conversation I get this exception:

An existing connection was forcibly closed by the remote host

In short my code looks like this:

var client = new DirectLineClient(_directLineSecret);
var conversation = await client.Conversations.StartConversationAsync().ConfigureAwait(false);
var conversationId = conversation.Result.ConversationId;

The directline secret should be correct as it is working fine within my webchat implementation.


Solution

  • There's an update on dec 14. You need to set your SecurityProtocol to TLS1.2

    "On December 4th, 2018, the Azure Bot Service will require all connections to be secured using Transport Layer Security (TLS) 1.2. This enforcement is critical to providing the best possible security for your data. "