Letsencrypt acme-challenge on wordpress or asp.net mvc

I tried unsuccessfully to create security certificates for my company using Let Encrypt. My company uses WordPress 3.9.7 for its main website, and I can’t upgrade to the new version, as this is being processed by a third party. The website runs on top of Internet Information Services 7.5 on Windows Server 2008 R2. My question is: how can I make a wordpress descriptor http://www.company.com/.well-known/acme-challenge/mftvrU2brecAXB76BsLEqW_SL_srdG3oqTQTzR5KHeA ? I already created a new blank page and a new template that exactly returns what encryption allows, but Wordpress continues to return 404 for this page. I assume that the problem occurs with a period (.) At the beginning of the route ("well known"), but I do not know how to solve this in wordpress.

I can also use the asp.net mvc website and force IIS to point to this site for a while. Not a good idea, though, since customers may not reach our website in a few minutes, but still an option. Then the question arises: how can I create a controller or route with a dot (".") At the beginning of the name? Help will be really appreciated.

+4
source share
1 answer

For ASP.Net MVC or web forms with specific routing configurations, you will treat this URL as something that can be passed to the MVC / Forms handler rather than returning a static file. The result will be 404 or 503. The solution is surprisingly simple:

If you have not already done so, put the Challenge file:

  • dirs - .well-known , Microsoft , cmdline, .well-known. Windows .
  • \.well-known\acme-challenge . ; Git Bash echo "oo0acontents" > abcdefilename

Web.Config acme-challenge :

<?xml version = "1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <clear />
            <mimeMap fileExtension = ".*" mimeType="text/json" />
        </staticContent>

        <handlers>
            <clear />
            <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule" 
            resourceType="Either" requireAccess="Read" />  
        </handlers>
    </system.webServer>
</configuration>

: https://github.com/Lone-Coder/letsencrypt-win-simple/issues/37

. 404/503, - .

: json, , letencrypt. - - /, .

+7

Source: https://habr.com/ru/post/1624149/


All Articles