Why Is My ASP.NET 8 Web App on App Service Failing to Make Outbound API Calls?

0
2
Asked By TechieGamer42 On

I've been working on a .NET 8 web app hosted on a Windows App Service plan, using the default configurations provided by Microsoft. Recently, it started having issues making outbound API calls to a third-party site. Previously, everything was functioning well. Now, whenever I attempt to connect, I encounter the error: "System.Security.Authentication.AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'."

I also tried using curl on Kudu to connect to the third-party site, but it resulted in an error: "curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g., handshake failed)." The troubling part is that the code runs without issues on my Windows 11 development machine. Has anyone experienced this before or have ideas for a workaround? I've attempted various solutions but nothing seems to resolve the error.

1 Answer

Answered By CodeWhisperer99 On

It sounds like this might be a certificate issue. Your local machine probably has the necessary certificate installed, which is why it works there but not on the App Service. You'll need to make sure that the certificate is added to your web app. Check out the documentation on managing certificates in Azure App Service for more details.

DevDude235 -

Yeah, that makes sense! The remote server may be using a certificate that's trusted on your Windows setup but not recognized by the App Service. Following the guidelines in Azure's certificate documentation should help you rectify this issue.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.