Home » Categories » Multiple Categories

How to solve the Let’s Encrypt SSL on ASP.NET Core

Problem: Let's Encrypt SSL fails to work even it has been activated on the Control Panel

Solution
This solution applies to ASP.NET Core application with MVC
The problem is that Let's Encrypt SSL targets a folder .well-know inside the application. As it does not exist on the httpdocs, and that no route is targeting it, MVC will return a 404 error message and then SSL Certificate will not work.

So the trick is to add the following code on the configure method from startup.cs

app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @".well-known")),
RequestPath = new PathString("/.well-known"),
ServeUnknownFileTypes = true // serve extensionless file
});

And you also need to add the folder to the root of the website

As Let's Encrypt SSL is a new feature to the Plesk Control Panel, occasionally, it will not work fine. We still highly recommend our customer to use a paid SSL for higher reliability and security reason

If there is any further issue, please open a support ticket via our Help Desk System

Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How do I query MySQL Database in PHP ?
Viewed 1725 times since Tue, May 1, 2012
Sample Code to Send email using ASP.NET 2
Viewed 3796 times since Tue, May 1, 2012
How do I redirect a subdomain to a subdirectory?
Viewed 2363 times since Tue, May 1, 2012
I get an error Server.CreateObject Failed when I try to use CDONTs. What can I do?
Viewed 1692 times since Tue, May 1, 2012
I receive this error message: "Directory Listing Denied. This Virtual Directory does not allow contents to be listed."
Viewed 4838 times since Mon, Apr 30, 2012
My site is showing 500 Internal Server error message. What is wrong here?
Viewed 2219 times since Thu, May 3, 2012
I cannot see my website. What should I do?
Viewed 2348 times since Thu, May 3, 2012