0

我正在尝试将我通过 Visual Studio 2015 用 C# 编写的机器人发布到 AWS。我安装了 Amazon Cloud SDK 并能够成功地将机器人发布到 AWS。我用它提供的地址更新了机器人端点(http://benbot-dev.us-west-2.elasticbeanstalk.com/)。但是当我访问 Microsoft Bots 站点并测试机器人连接时,它显示无法连接到远程服务器。请帮忙。我认为这是 https 端点问题。但我不确定如何获取 API Gateway 端点,如果我应该这样做的话。

<<<<<<<<<<
500 InternalServerError
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 52.42.245.162:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- 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.<PingV3BotAsync>d__54.MoveNext() in C:\a\1\s\DevPortalLib\Controllers\BotManagerController.cs:line 1420
>>>>>>>>>>>>>>>>
4

1 回答 1

0

此异常消息告诉您,在您的服务器代码中,您试图访问位于 52.42.245.162 的服务器,并且该服务器不可访问(更具体地说,https 端口 443 不可访问)。此 IP 解析为某个 AWS 主机(使用nslookup命令找出这一点,请参阅此答案)。您可以尝试 ping 此 IP,或尝试查看端口 80 是否可以访问(两者都不是来自我的主机)。或者您可以尝试枚举该主机上是否打开了任何其他端口(搜索 google/bing 以获取如何执行此操作的说明)。如果您无法从主机访问该端口,Microsoft Bots 站点也无法访问它。如果您的服务在该 IP 上运行,最可能的原因是您必须在 AWS 上打开端口才能从公共互联网访问(搜索 google/bingaws open portaws allow ssh

于 2016-08-18T12:01:27.800 回答