- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
因此,要安装 Let's Encrypt SSL 证书,我需要转到我的 Plesk 帐户,选择一个域或子域并单击 Let's Encrypt,然后我只有一个用于输入电子邮件地址的字段和一个用于安装的按钮。
要安装,Let's Encrypt 会向我的网站发送 HTTP 请求:
GET /.well-known/acme-challenge/n9cD8Lpv-woEU73NhCUdFyqOYMc5hrANF_byoiaYrZc - HTTP/1.1
如果我通过 Plesk 创建一个新的“站点”,并安装证书,则 GET 请求会得到一个很好的 200 响应,并且 SSL 证书安装正常。
但是,我有一个未安装 SSL 的“沙箱”,然后我将 ASP.NetCore 应用程序部署到“沙箱”进行暂存,然后尝试安装 SSL 证书。当 ASP.NetCore 应用程序运行时,当 Let's Encrypt 发送 GET 请求时,会导致 404 错误并且安装失败。
有人遇到过这种情况吗?我需要配置什么?是 MVC 路由还是 AngularJS (~1.5) 路由在干扰?
我在任何地方都没有看到/.well-known/* 目录,我不确定它是否被隐藏,但我无法访问它,所以如果我需要的话,我怎么知道要配置什么在路由中配置某些内容以允许 GET/.well-known/acme-challenge/*
?
远程主机技术支持没有任何帮助。他们告诉我要等 72 小时,因为我尝试了很多次,但我只是被锁在门外(但我没有)
这是实际的 Plesk 错误消息
Let's Encrypt SSL certificate installation failed: Challenge marked as invalid. Details: Invalid response from http://my-domain.net/.well-known/acme-challenge/AJsMc3HXiOZRGaFVsMR3uZEdYu1moJ2Po62t3e6uV10 [my-ip]: 404
我相当确定我可以通过删除我的网站、安装 SSL 证书而不是再次上传来“解决”这个问题,但我想知道到底发生了什么,以及我是否可以正确处理它。
事后思考
Let's Encrypt 是一项 30 天自动续订服务。如果我的 ASP.NET 应用程序阻止安装,那么它也会阻止自动续订,因此我必须每 30 天删除我的网站并重新部署,这是 Not Acceptable !
已解决这是针对这个非常具体的场景的解决方案。
还有其他可行的解决方案,当然此解决方案仅适用于 IIS Web 服务器。
最佳答案
快速搜索后发现了这个小 gem
这似乎符合您的特定问题。
To get a certificate, let’s encrypt verify that you own the domain byrequesting a file on your server. In this case, the file is notaccessible (status 404). Let’s understand what happened.
IIS get the request, and find the associated web site. Then itexecutes handlers in order until one send the response. ASP.NET Corehandler is the first to handle the request.
The challenge file is in the folder “.well-known/…”, but by defaultASP.NET Core serves only files located in the folder “wwwroot” => so,a 404 response is send to the client. ASP.NET Core has handled therequest; therefore, the IIS Static file handler is not called.
As a workaround, you can move up the “StaticFile” handler, but yourwebsite may not work as expected. A better solution is to instructyour ASP.NET Core website to send the file located in the directory“.well-known”.
This is possible by registering it:
public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
//...other configs
app.UseStaticFiles(); // wwwroot
var wellKnownDirectory = Path.Combine(Directory.GetCurrentDirectory(), @".well-known");
if (!Directory.Exists(wellKnownDirectory))
Directory.CreateDirectory(wellKnownDirectory);
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(wellKnownDirectory),
RequestPath = new PathString("/.well-known"),
ServeUnknownFileTypes = true // serve extensionless file
});
//...other configs
app.UseMvc();
}
这基本上通过核心路由对虚拟路径的调用,核心获取物理路径并向调用者提供文件内容。现在应该允许验证域并让证书请求流程完成并自动续订。
查看该文章及其建议的解决方法,因为似乎没有涉及太多其他步骤。
关于angularjs - ASP.Net 应用程序干扰远程主机 Let's Encrypt(通过 Plesk)安装?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44732729/
我在这里想做的是将所有连接转发到机器一上端口 3306 上的本地主机到本地主机上端口 3306 上的机器二。因此,如果您连接到机器一上的 mysql,它的行为就像您正在连接一样在二号机器上。 我认为
通过Kibana界面,如何获得 flex IP /主机? 我的意思是,与kibana连接的Elastic主机。 那有可能吗?我在这个上挣扎了好几个小时,却一无所获:( 附:不确定此问题是否是题外话,应
我知道这听起来很奇怪,但我有一个情况,Deno 需要关闭自己的主机(并因此杀死自己的进程)。这可能吗? 我特别需要这个用于 linux (lubuntu),如果相关的话。我想这需要 sudo 权限,这
我知道这听起来很奇怪,但我有一个情况,Deno 需要关闭自己的主机(并因此杀死自己的进程)。这可能吗? 我特别需要这个用于 linux (lubuntu),如果相关的话。我想这需要 sudo 权限,这
我有一个基本问题,但谷歌并没有为我产生很多结果(反正不是英文的)。基本上我想做的就是: 我有一个图形需要用作整个应用程序的持久 header ,例如:我不能让它在新的 Intent 调用时从屏幕上滑出
您好,我正在使用 xampp,我正在尝试使用 php 进行连接。 $sql_connections = mysql_connect("$server, $username, $password")
我目前正在尝试一些多人游戏的想法,并正在尝试创建一个 Java 应用程序来为基于网络浏览器的多人游戏提供服务。 我的开发环境是主机上的Eclipse, native 上的notepad + Googl
今天为大家分享一篇关于SSH 的介绍和使用方法的文章。本文从SSH是什么出发,讲述了SSH的基本用法,之后在远程登录、端口转发等多种场景下进行独立的讲述,希望能对大家有所帮助。 什么是SSH?
我已经完成了在裸机 Centos 7 上运行的测试 Kubernets 主机的设置。这将用作测试系统,因为我们将在 IBM Bluemix Kubernetes 服务中部署所有内容。 从 Bluemi
我正在尝试通过带有 4.2(果冻 bean )的 android 设备“nexus 7”通过 USB 与我的 freeduino 板进行通信,该板类似于 arduino uno。 几个月后,我使用开发
我正在使用 nginx,但在设置反向代理时遇到问题。 我的 nginx.conf 是默认的(没有对其进行任何更改),我的站点可用配置是: upstream backend_hosts { se
我在 projectlocker(免费 svn 主机)上有一个帐户,但我不知道如何将我的项目文件上传到它。 我在我的仪表板中找不到任何选项。 我在我的电脑上使用tortoiseSvn,那么如何上传文件
设置batchSize = 1有意义吗?如果我想一次处理一个文件? 尝试过batchSize = 1000和batchSize = 1 - 似乎具有相同的效果 { "version": "2.0"
我只想知道.. docker中现在有任何可用的工具吗?我已经阅读了Docker中有关多主机功能的一些文档,例如, Docker群 Docker服务(带有副本) 我也知道群模式下的volume问题,容器
我想将文件从 Docker 的容器挂载到我的 docker 主机。 数据卷不是我的解决方案,因为它们是从 docker 主机到 docker 容器的装载,我需要相反的方法。 谢谢 最佳答案 当 doc
我是新手。我无法正确理解RMI。互联网上有大量教程,但据我所知,它们都是针对本地主机的。服务器和客户端都运行在同一台机器上。 我想在任何计算机上运行客户端,并且主机将位于一台计算机上,让我们考虑IP
我无法从客户端“A”SSH 到服务器“B”(但我可以从同一子网上的许多其他 ssh 客户端而不是“A”——所有都是 *nux 机器) serverA>ssh -v -p 端口用户@serverB Op
设置batchSize = 1有意义吗?如果我想一次处理一个文件? 尝试过batchSize = 1000和batchSize = 1 - 似乎具有相同的效果 { "version": "2.0"
由于我不是天生的编码员,请多多包涵。 这是我尝试使用HAproxy来实现的目标,但是经过数小时的检查后,我无法以某种方式使其工作。 从 domain.com/alpha domain.com/beta
我正在使用 tomcat 运行 Java Web 应用程序,通过电子邮件将生成的报告发送给用户。我可以发送电子邮件,但几个小时后服务器停止发送电子邮件,并出现以下错误。 javax.mail.Mess
我是一名优秀的程序员,十分优秀!