如何仅为子域创建 Let's Encrypt 自签名证书? (错误 post)

How to create a Let’s Encrypt self signed certificate for a subdomain only? (error in post)

如何为子域创建 Let's Encrypt 自签名证书?

具体来说:

跟随 the following instructions 时,出现以下错误:

>>> sudo -H ./letsencrypt-auto certonly --standalone -d sub.domain.com --register-unsafely-without-email
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for sub.domain.com
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. sub.domain.com (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Timeout

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: sub.domain.com
   Type:   connection
   Detail: Timeout

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.

您需要 运行 服务器上的命令,因为该命令验证您控制域,所以如果它不在服务器上,则无法正确验证。

您可以为子域创建 Let's Encrypt 证书,而无需将 domian 指向任何根。

  • 登录DNS管理并为子域创建一个NAME记录。对于 A NAME,您需要 IP 地址
    • 验证 sub.domian.com 可通过互联网访问。
    • 运行 sub.domian.com.
    • 的脚本

https://zerossl.com/free-ssl/#crt 也可用于生成证书和密钥,但是需要一些手动步骤来创建 .well-known 并且需要在 sub.domian.com /DocumentRoot[ 中创建 aceme-challenge 文件夹=11=]