question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suddenly encountered "Could not create SSL/TLS secure channel"

See original GitHub issue

“Could not create SSL/TLS secure channel”.

I am using telegram bot for long time, but it stopped working now. While debugged got the error “Could not create SSL/TLS secure channel”.

Error

System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Telegram.Bot.TelegramBotClient.<MakeRequestAsync>d__54`1.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at TelegramBotAPI.Controllers.WebhookController.<Post>d__5.MoveNext()

Server and SSL

TLS 1.2, AES with 256 bit encryption (High); ECDH with 384 bit exchange

Efforts

I have tried to allow Expect100Continue and Security Protocol with all tls protocols.

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Steps to reproduce

No sure.

Expected behavior

It should send message.

Actual behavior

Its not sending message.

Screenshots

I am using code to send message just for sample. await bot.SendTextMessageAsync(chatId: update.Message.Chat.Id, text: string.Format("Welcome to {0}, We are processing your registration.", botName)); image

Environment data

NuGet Package Version: (e.g. 13.0.1) 15.3.0

.NET Version: (e.g. 4.7, Core 1.1, Mono, etc.) .Net Framework 4.6

IDE: (e.g. VS2017, VS Code, etc.) VS 2017

App: (e.g. Desktop, iOS, Android, etc.) Telegram Android Client, Chrome for Webhooks debug, ngrok

Please let me know if you need more information.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tuscencommented, Feb 6, 2020

Sorry for this mess with reopening, I missed some details.

Telegram now allows only TLS v1.2. You probably need to use this ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

1reaction
amoamarecommented, Feb 6, 2020

@jayanti-prajapati, can you load IISCrypto on cipher suites double check that TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 is enabled. This was my issue. Ensuring this was enabled and still using the servicepointmanager to force Tls12 solved my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - The request was aborted: Could not create SSL/TLS ...
Another possible cause of the The request was aborted: Could not create SSL/TLS secure channel error is a mismatch between your client PC's...
Read more >
The request was aborted: Could not create SSL/TLS ...
This error generally will correspond to firewalls, proxies or DNS filtering blocking the connection or an SSL/TLS cipher misconfiguration. Topics covered in ...
Read more >
The request was aborted: Could not create SSL/TLS ...
Open Run Prompt and run gpedit.msc · Navigate to "Administrative Templates > Network > SSL Configuration Settings" · Open SSL Cipher Suite Order ......
Read more >
Solved: The request was aborted: Could not create SSL/TLS
Solved: Hello Guys, I keep getting the error The request was aborted: Could not create SSL/TLS secure channel. when i try call the...
Read more >
.NET Error - The request was aborted: Could not create ...
This exception message typically indicates that a secure channel could not be created due to the client application failing to specify a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found