I'm trying to create a Node.js based skype bot, but when I hit "test" on botframework I always receive this error
500 InternalServerError System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult) at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Intercom.DevPortal.Server.Controllers.BotManagerController.d__76.MoveNext() in C:\a\1\s\DevPortalLib\Controllers\BotManagerController.cs:line 2032
This is my app.js file
var restify = require('restify');
var builder = require('botbuilder');
var fs = require('fs');
var https_options = {
key: fs.readFileSync('/root/skypeBot/priv.key'),
certificate: fs.readFileSync('/root/skypeBot/key.crt'),
passphrase: 'secretphrase'
};
var server = restify.createServer(https_options);
server.listen(process.env.port || process.env.PORT || 3978, 'myip', function(){
console.log("%s listening to %s", server.name, server.url);
});
var connector = new builder.ChatConnector({
appId: myAppId,
appPassword: myAppPassword
});
var bot = new builder.UniversalBot(connector);
server.post('/api/messages', connector.listen());
bot.dialog('/', function(session){
session.send("HELLO worls");
});
When testing the connection to your bot via the Bot Portal at https://dev.botframework.com, a successful test will result in "Accepted".
If you don't see "Accepted" after clicking test bot connection button, this could be one of two scenarios:
/api/messagesendpoint.Based on the date the original question was posted, there may have been an error in the Bot Portal. The Bot Portal has seen many improvements since then. The most likely scenario, if you're still experiencing the issue, is an error in your bot deployment configuration. Make sure your bot's
/api/messagesendpoint is accepting POST requests, then try testing your bot connection again.