ASP.NET Core & IONOS SSL Certificate: ERR_SSL_PROTOCOL_ERROR

Happy Development 20 Reputation points
2023-03-20T00:43:11.4233333+00:00

I am testing an asp.net core web API application with Swagger from Visual Studio 2022 in a windows hosting pack at IONOS.

When I create an application of the asp.net core web API and uncheck the "Configure for HTTPS" option, and publish the application via FTP, it works with HTTP. However, when I check the "Configure for HTTPS" option, which is how it should work with HTTPS, and publish the application via FTP, I cannot access it, neither by HTTP nor by HTTPS. It always redirects to HTTPS but I receive the ERR_SSL_PROTOCOL_ERROR when trying to access it via HTTPS.

I would appreciate it if you could give me some guidance on how to solve this error, because I always receive this error from any device.

On the one hand, the SSL certificate is active from the IONOS panel, and I only enable the "Configure for HTTPS" check from Visual Studio, but I never "use" the IONOS certificate in my app. I have never used certificates in ASP.NET, so I don't know where the problem may be.

In summary, when creating an asp.net core web API application:

"Configure for HTTPS" unchecked:
HTTP = I can access the app
HTTPS = ERR_SSL_PROTOCOL_ERROR

"Configure for HTTPS" checked:
HTTP = Redirects to HTTPS
HTTPS = ERR_SSL_PROTOCOL_ERROR

aspnet-core-additional-information-dialog

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,166 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,127 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 43,941 Reputation points
    2023-03-20T14:22:32.6266667+00:00

    Hello there,

    The ERR_SSL_PROTOCOL_ERROR occurs when a website cannot provide a secure connection. This may be due to issues on the website, such as not forcing HTTPS or not having an SSL certificate. A problem with your browser may also cause the ERR_SSL_PROTOCOL_ERROR

    This tutorial teaches the basics of building a controller-based web API that uses a database. Another approach to creating APIs in ASP.NET Core is to create minimal APIs.

    https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-7.0&tabs=visual-studio

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–


  2. Happy Development 20 Reputation points
    2023-03-20T17:04:28.7+00:00

    I solved the problem was how the SSL certificate was set to use mode "On my own server" instead of "Use with my IONOS website".

    0 comments No comments

  3. DotNetCrazy 0 Reputation points
    2023-03-21T07:00:54.6466667+00:00

    Hi,

    How did you setup your SSL? From error message above, it is SSL issue. Have you purchased SSL certificate or using Free SSL certificate? If you are using Plesk panel, you can refer to this post https://windowswebhostingreview.com/setup-free-lets-encrypt-ssl-hosting/ about how to setup Let's Encrypt