我正在尝试将certbot
(Let's Encrypt)用于本地域。
在/etc/hosts
我有这个。
127.0.0.1 myapp.whitebear.com
但是当我运行certbot
(Let's Encrypt) 时显示此错误。
如何为本地主机设置 HTTPS?
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for myapp.whitebear.com
Waiting for verification...
Challenge failed for domain myapp.whitebear.com
http-01 challenge for myapp.whitebear.com
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: myapp.whitebear.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for myapp.whitebear.com
要使用 Let's Encrypt 证书,您的域必须存在于 DNS 系统中。本地覆盖,例如
/etc/hosts
将不起作用。