让IIS的加密确认不起作用

问题描述 投票:3回答:2

我正在尝试使用Certify SSL Manager从我的IIS服务器上的Let's Encrypt配置SSL证书,但在检查期间失败了。

https://dev.mywebsite.com/.well-known/acme-challenge/configcheck/

这有效: https://dev.mywebsite.com/well-known/acme-challenge/configcheck https://dev.mywebsite.com/.well-known/acme-challenge/test.txt

所以我认为是的。之前众所周知。但是test.txt的工作让我很困惑。

我已经根据这个讨论配置了目录:https://github.com/ebekker/ACMESharp/issues/15

我的web.config中有一堆重写内容,但即使我完全删除了该部分,它仍然会失败。

更新: @ Paul0515与此相结合的建议似乎已经解决了这个问题

public static void RegisterRoutes(RouteCollection routes)
{
    //this is for the "Let's Encrypt" SSL confirmation
    routes.IgnoreRoute(".well-known/");
}
iis lets-encrypt
2个回答
3
投票

也许检查acme-challenge web.config是否在处理程序部分中包含冲突。通过打开IIS管理器,找到acme-challenge文件夹,双击处理程序映射图标。就我而言,这导致了一个错误。

我在acme-challenge文件夹中使用默认web.config遇到的问题是applicationhost.config包含:

<section name="handlers" overrideModeDefault="Deny" />

因此,不允许在acme-challenge web.config中处理程序部分,结果是挑战失败。在这种情况下,解决方案是:将applicationhost.config行更改为:

<section name="handlers" overrideModeDefault="Allow" />

或者......从acme-challenge文件夹中的web.config中删除处理程序设置。

可以在此处找到applicationhost.config:c:\ windows \ system32 \ inetsrv \ config


1
投票

configcheck url是一个文件,而不是目录。确保webroot中的磁盘(即C:\inetpub\wwwroot\.well-known\acme-challenge\configcheck)上存在该文件。然后尝试在您的网站根目录中使用此准系统web.config加载链接(如果使用ASP.NET):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension="." mimeType="application/unknown" />
        </staticContent>
    </system.webServer>
</configuration>

如果可行,请尝试在web.config部分中慢慢添加,包括路由/重写,直到找出导致问题的原因。

如果将ASP.NET Core与托管静态文件的wwwroot文件夹一起使用,则必须在Startup.cs中修改配置:

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    string filepath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot/.well-known");
    app.UseStaticFiles(new StaticFileOptions()
    {
        FileProvider = new PhysicalFileProvider(filepath),
        RequestPath = new PathString("/.well-known"),
        ServeUnknownFileTypes = true
    });
    // ... your other startup code here
}
© www.soinside.com 2019 - 2024. All rights reserved.