Real people, 24/7(800) 395-7779

Using Let's Encrypt with nopCommerce (and Other ASP.NET Core Sites) in Plesk Print

  • nopcommerce, plesk, let's encrypt, ssl
  • 0

nopCommerce 4.x and newer (and many other ASP.NET Core applications) send every request to the application, including the /.well-known/acme-challenge/ files that Let's Encrypt uses to verify your domain. When that happens, Plesk cannot issue or renew the free certificate. The fix is a small web.config file in the verification folder that tells IIS to serve those files directly.

Before you start: Your domain and www must already point to your PeoplesHost server.

Step-by-Step Guide:

  1. Make sure SSL/TLS support is on:

    • Log in to Plesk, go to Websites & Domains, find your domain and open Hosting & DNS > Hosting.
    • Tick SSL/TLS support and click Save.
  2. Try to issue the certificate once:

  3. Edit the web.config in the verification folder:

    • Click Files in the left menu and open httpdocs > .well-known > acme-challenge.
    • Open web.config in the editor (create it if it is missing) and replace its contents with the code below, then save.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <clear />
        <rule name="block" stopProcessing="true">
          <match url="(.*)well-known/acme-challenge/(.*)" />
          <action type="None" />
        </rule>
      </rules>
    </rewrite>
    <handlers>
      <clear />
      <add name="StaticFile" path="*" verb="*" type="" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
    <staticContent>
      <mimeMap fileExtension="." mimeType="text/json" />
    </staticContent>
  </system.webServer>
  <system.web>
    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
</configuration>
  1. Issue the certificate again:

    • Go back to SSL/TLS Certificates and request the Let's Encrypt certificate again. It should now succeed.
    • Turn on Redirect from HTTP to HTTPS if you want all visitors on HTTPS.

Important:

  • Keep the .well-known folder. If you republish your site with Visual Studio, Web Deploy or FTP using "delete existing files", the folder and this web.config can be removed and the certificate will fail to renew. Exclude .well-known from deletion in your publish profile.
  • For nopCommerce's own HTTPS settings, see Enabling an SSL certificate in nopCommerce.

Need help? Open a ticket at https://my.peopleshost.com/submitticket.php and our support team will be glad to assist.


Was this answer helpful?

« Back