| Home » Categories » Multiple Categories |
How to solve the Let’s Encrypt SSL on ASP.NET Core |
|
Article Number: 314 | Rating: 4/5 from 1 votes | Last Updated: Tue, Sep 23, 2025 at 10:57 PM
|
| 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
There are no attachments for this article.
|
Do you support ASP.NET MVC 6?
Viewed 5345 times since Wed, Feb 17, 2016
Sample Code to Send email using ASP.NET1.1
Viewed 5909 times since Tue, May 1, 2012
How to solve ReportViewer error message: "An error has occurred during report processing. Input string was not in a correct format"
Viewed 8707 times since Tue, Jun 18, 2013
I am unable to renew my Let’s Encrypt SSL
Viewed 3080 times since Thu, Aug 23, 2018
My application pool stops working. What is wrong with my site?
Viewed 13785 times since Sun, Feb 15, 2015
My website session times out earlier than expected. Why?
Viewed 5428 times since Tue, May 1, 2012
How do I redirect a subdomain to a subdirectory?
Viewed 4557 times since Tue, May 1, 2012
About Azure Key Vault
Viewed 2345 times since Mon, Nov 2, 2020
Do you allow custom COM components?
Viewed 3375 times since Tue, May 1, 2012
HTTP Error 502.5 - Process Failure error message when publishing an ASP.NET Core Website
Viewed 11345 times since Mon, Mar 27, 2017
|
