Azure LetsEncrypt 无法访问我的函数的 .well-known/acme-challenge

标签 azure ssl-certificate azure-functions lets-encrypt

我正在尝试使用 Azure 的 LetsEncrypt 站点扩展为我的 Azure 功能启用 SSL,如所述 here 。我按照该 wiki 和此 website 中的说明进行操作.

但是,当它尝试验证网站时,我收到错误。

该错误表示无法访问 acme-challenge 页面 (404)。

这是我的.well-known/下的web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <clear />
      <add name="ACMEStaticFile" path="*" verb="*" modules="StaticFileModule" resourceType="Either" requireAccess="Read" />
    </handlers>
    <staticContent>
      <remove fileExtension="." />
      <mimeMap fileExtension="." mimeType="text/plain" />
    </staticContent>
  </system.webServer>
  <system.web>
    <authorization>
      <allow users="*"/>
    </authorization>
  </system.web>
</configuration>

有人对可能出现的问题有任何想法吗?

最佳答案

以下是您可以做到这一点的方法。

在您的函数应用中,为挑战目录创建一个新代理(这是必需的,因为挑战将是对 /.well-known/acme-challenge/的 http 获取,并且默认情况下函数应用中的函数只会在 /api/ 上响应。

您可以通过以下方式设置代理。 enter image description here

代理.json

{
  "$schema": "http://json.schemastore.org/proxies",
  "proxies": {
    "LetsEncryptProxy": {
      "matchCondition": {
        "route": "/.well-known/acme-challenge/{code}"
      },
      "backendUri": "http://%WEBSITE_HOSTNAME%/api/letsencrypt/.well-known/acme-challenge/{code}"
    }
  }
}

这里的重要设置是路由模板:/.well-known/acme-challenge/{*rest} 这将匹配所有进入挑战目录的请求。

请注意,代理是一项预览功能,您必须启用它才能正常工作。

引用: https://github.com/sjkp/letsencrypt-siteextension/wiki/Azure-Functions-Support https://blog.bitscry.com/2018/07/06/using-lets-encrypt-ssl-certificates-with-azure-functions/

关于Azure LetsEncrypt 无法访问我的函数的 .well-known/acme-challenge,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56333957/

相关文章:

ssl - 如何在 IBM Cloud CloudFoundry 应用程序中激活证书?

android - Cordova SSL 固定错误 500 : "There was an error with the request"

azure - 在使用javascript的azure函数中如何调用向端点发送请求

c# - 在.NET Core内置DI容器中实现AddScoped服务的自定义处置

sql-server - 将 Azure SQL 数据库从 P15 (2TB) 降级到 P4 (500GB)

azure - 通过 API 在 Azure 数字孪生中创建多个孪生

java - ssl 证书错误 : unable to get local issuer certificate

azure - 在本地调试两个 Azure Functions 项目

python - 通过 Azure DevOps Python API 创建 VSTS PBI

azure - 流分析提示发送到 power bi 的数据类型