6

I am using Windows Server 2012 R2 on my production server. I upgraded my webapplication to .Net 5.0 from 4.5. Now randomly facing this error, while communication of my front-end applications with the backend REST API built on .Net 5.0:

Exception[System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.) ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'. ---> System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted.

--- End of inner exception stack trace ---

I have already used the below lines of code in my app:

 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
  • Di you get an answer to this? – Rippo Mar 15 '23 at 13:47
  • no didnt get answer. I came to the conclusion that probably there is some conflict between the OS (Windows Server 2012) and .Net 6.0. Some people have reported the same on various forums – Shazia Tabassum Mar 20 '23 at 09:13
  • In the end I was forced to put code on a 2019 server. However when looking at `IIS Crypto` it may be down to some ciphers begin removed. As its a live server I cant reboot it multiple times to find the right ones! – Rippo Mar 20 '23 at 13:13

0 Answers0