SSL_ERROR_RX_RECORD_TOO_LONG error when checking Blob URI with SAS token has not expired

Tim Morrison 0 Reputation points
2023-07-25T10:58:48.3433333+00:00

Hi, I have a service that stores files in Blob/Containers, and each file is listed in my web app with a URI to download it, protected with a SAS token. In order to avoid presenting the ugly XML "token expired" response when the SAS Token expires, I send the URI for the blob through a proxy that checks if it is still valid first.

I used this resource for guidance:

https://www.codingwithmiszu.com/2021/12/06/handling-expired-azure-blob-storage-links-in-a-user-friendly-way/

Therefore the link the user clicks to retrieve any given blob is in the following format:

https://mywebsite.com/proxy-controller/check?originalUrl=[SAS Token URI for Blob]

The orginal SAS Token URI is appended as a QueryString, and the controller action examines the time element to see if it's expired - if it has, it redirects it to a friendly error page, if not, it proceeds to download the blob.

This functions beautifully when run through VS locally. When deployed to my app service (Linux) I receive the SSL_ERROR_RX_RECORD_TOO_LONG error.

The app service is using a custom domain with an App Service Managed Certificate.

Here is a sample of the link being sent to the proxy:

https://mywebsite.io:80/proxy/check?originalUrl=https%3a%2f%2fmywebsite.blob.core.windows.net%2fspoonman%2fB326BC4F-4B5D-44A7-BC86-C138E8F86045%3fsv%3d2021-10-04%26se%3d2023-07-25T10%253A42%253A33Z%26sr%3db%26sp%3drw%26rscd%3dattachment%253Bfilename%2xxxx.jpg%26sig%3dghAurtR8ho07evAeDch%252F41eKlGuY5eOzNEaeQdjhXi4%253

I'm assuming my issue is with the App Service Managed Certificate SSL - is this something I can change or does it require a different certificate? All help is very gratefully appreciated!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,400 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,778 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,289 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,269 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.