TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.17k stars 686 forks source link

The request was aborted: Could not create SSL/TLS secure channel. #870

Closed terryaney closed 4 years ago

terryaney commented 4 years ago

I found a bug to report

Steps to reproduce

        var bot = new TelegramBotClient("mybotid");
        await bot.SendTextMessageAsync(
            chatId: new Telegram.Bot.Types.ChatId(mytelegramIntId),
            text: "HI",
            parseMode: ParseMode.Markdown
        );

Expected behavior

I receive the message. This worked previously. February 5th was last successful message I received and I'm not seeing any update history that would affect that.

image

Actual behavior

Exception: Message - An error occurred while sending the request. StackTrace:

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Telegram.Bot.TelegramBotClient.d541.MoveNext()
--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at UserQuery.TelegramNotification.d
0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()   at UserQuery

d__0.MoveNext()

Inner Exception: Message - The request was aborted: Could not create SSL/TLS secure channel. StackTrace -

at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) | at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)

Environment data

NuGet Package Version: 15.3 Environment.Version: 4.0.30319.42000 Environment.OSVersion.VersionString: Microsoft Windows NT 6.3.9600.0

IDE: LINQPad App: LINQPAD OS: Windows 2012 R2 Server

tuscen commented 4 years ago

Please, search other issue before posting a new one

868

https://github.com/TelegramBots/Telegram.Bot/issues/867#issuecomment-583138884

terryaney commented 4 years ago

Was just coming to close. I searched with 'google' and nothing showed up. Then after submitting my bug, I saw those. Sorry about that.