Dokku + letsencrypt:能够为子域而不是根域获得ssl

问题描述 投票:0回答:1

我正在使用服务器端CLI为我的Web应用程序获取SSL(遵循以下说明:https://github.com/dokku/dokku-letsencrypt)。

完成设置后,我运行:

root@taaalk:~# dokku letsencrypt taaalk

=====> Let's Encrypt taaalk

-----> Updating letsencrypt docker image...

0.1.0: Pulling from dokku/letsencrypt

Digest: sha256:af5f8529c407645e97821ad28eba328f4c59b83b2141334f899303c49fc07823

Status: Image is up to date for dokku/letsencrypt:0.1.0

docker.io/dokku/letsencrypt:0.1.0

Done updating

-----> Enabling ACME proxy for taaalk...

[ ok ] Reloading nginx configuration (via systemctl): nginx.service.

-----> Getting letsencrypt certificate for taaalk...

- Domain 'taaalk.taaalk.co'

darkhttpd/1.12, copyright (c) 2003-2016 Emil Mikulic.

listening on: http://0.0.0.0:80/

2020-04-28 23:12:10,728:INFO:__main__:1317: Generating new account key

2020-04-28 23:12:11,686:INFO:__main__:1343: By using simp_le, you implicitly agree to the CA's terms of service: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf

2020-04-28 23:12:12,017:INFO:__main__:1406: Generating new certificate private key

2020-04-28 23:12:14,753:ERROR:__main__:1388: CA marked some of the authorizations as invalid, which likely means it could not access http://example.com/.well-known/acme-challenge/X. Did you set correct path in -d example.com:path or --default_root? Are all your domains accessible from the internet? Please check your domains' DNS entries, your host's network/firewall setup and your webserver config. If a domain's DNS entry has both A and AAAA fields set up, some CAs such as Let's Encrypt will perform the challenge validation over IPv6. If your DNS provider does not answer correctly to CAA records request, Let's Encrypt won't issue a certificate for your domain (see https://letsencrypt.org/docs/caa/). Failing authorizations: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4241725520

2020-04-28 23:12:14,757:INFO:__main__:396: Saving account_key.json

2020-04-28 23:12:14,758:INFO:__main__:396: Saving account_reg.json

Challenge validation has failed, see error log.

Debugging tips: -v improves output verbosity. Help is available under --help.

-----> Certificate retrieval failed!

-----> Disabling ACME proxy for taaalk...

[ ok ] Reloading nginx configuration (via systemctl): nginx.service.

done

root@taaalk:~#

因此读取错误更容易了:

2020-04-28 23:12:14,753:ERROR:__main__:1388: CA marked some of the authorizations as invalid, which likely means it could not access http://example.com/.well-known/acme-challenge/X. Did you set correct path in -d example.com:path or --default_root? Are all your domains accessible from the internet? Please check your domains' DNS entries, your host's network/firewall setup and your webserver config. If a domain's DNS entry has both A and AAAA fields set up, some CAs such as Let's Encrypt will perform the challenge validation over IPv6. If your DNS provider does not answer correctly to CAA records request, Let's Encrypt won't issue a certificate for your domain (see https://letsencrypt.org/docs/caa/). Failing authorizations: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4241725520

我进行了大量的谷歌搜索,发现关于该主题的最有希望的帖子是这个:

https://veryjoe.com/tech/2019/07/06/HTTPS-dokku.html

[帖子中建议检查我的Dokku domain misconfigurationmissing network listeners

我运行dokku domains:report来检查配置错误。这返回:

root@taaalk:~# dokku domains:report
=====> taaalk domains information
       Domains app enabled:           true                     
       Domains app vhosts:            taaalk.taaalk.co         
       Domains global enabled:        true                     
       Domains global vhosts:         taaalk.co 

然后我跑dokku network:report检查缺少的听众:

root@taaalk:~# dokku network:report
=====> taaalk network information
       Network attach post create:    
       Network attach post deploy:    
       Network bind all interfaces:   false
       Network web listeners:         172.17.0.4:5000

与朋友交谈之后,我们尝试使用主机'taaalk.taaalk.co'向我的DNS添加'A'记录。

然后我跑了:

root@taaalk:~# dokku letsencrypt taaalk
=====> Let's Encrypt taaalk
-----> Updating letsencrypt docker image...
0.1.0: Pulling from dokku/letsencrypt
Digest: sha256:af5f8529c407645e97821ad28eba328f4c59b83b2141334f899303c49fc07823
Status: Image is up to date for dokku/letsencrypt:0.1.0
docker.io/dokku/letsencrypt:0.1.0
       Done updating
-----> Enabling ACME proxy for taaalk...
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
-----> Getting letsencrypt certificate for taaalk...
        - Domain 'taaalk.taaalk.co'
darkhttpd/1.12, copyright (c) 2003-2016 Emil Mikulic.
listening on: http://0.0.0.0:80/
2020-04-30 13:39:58,623:INFO:__main__:1406: Generating new certificate private key
2020-04-30 13:40:03,879:INFO:__main__:396: Saving fullchain.pem
2020-04-30 13:40:03,880:INFO:__main__:396: Saving chain.pem
2020-04-30 13:40:03,880:INFO:__main__:396: Saving cert.pem
2020-04-30 13:40:03,880:INFO:__main__:396: Saving key.pem
-----> Certificate retrieved successfully.
-----> Installing let's encrypt certificates
-----> Unsetting DOKKU_PROXY_PORT
-----> Setting config vars
       DOKKU_PROXY_PORT_MAP:  http:80:5000
-----> Setting config vars
       DOKKU_PROXY_PORT_MAP:  http:80:5000 https:443:5000
-----> Configuring taaalk.taaalk.co...(using built-in template)
-----> Creating https nginx.conf
       Enabling HSTS
       Reloading nginx
-----> Configuring taaalk.taaalk.co...(using built-in template)
-----> Creating https nginx.conf
       Enabling HSTS
       Reloading nginx
-----> Disabling ACME proxy for taaalk...
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
       done

哪个成功了。

但是,现在taaalk.taaalk.co具有SSL,但taaalk.co没有SSL。]

我不知道从这里去哪里。我认为将虚拟主机从taaalk.taaalk.co更改为taaalk.co是有道理的,但是我不确定这是否正确或如何执行。 Dokku文档似乎并未涵盖如何更改虚拟主机名:http://dokku.viewdocs.io/dokku/configuration/domains/

谢谢您的帮助

更新

我将虚拟主机更改为taaalk.co,所以现在有了:

root@taaalk:~# dokku domains:report
=====> taaalk domains information
       Domains app enabled:           true                     
       Domains app vhosts:            taaalk.co                
       Domains global enabled:        true                     
       Domains global vhosts:         taaalk.co  

但是,仍然出现以下错误:

root@taaalk:~# dokku letsencrypt taaalk
=====> Let's Encrypt taaalk
-----> Updating letsencrypt docker image...
0.1.0: Pulling from dokku/letsencrypt
Digest: sha256:af5f8529c407645e97821ad28eba328f4c59b83b2141334f899303c49fc07823
Status: Image is up to date for dokku/letsencrypt:0.1.0
docker.io/dokku/letsencrypt:0.1.0
       Done updating
-----> Enabling ACME proxy for taaalk...
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
-----> Getting letsencrypt certificate for taaalk...
        - Domain 'taaalk.co'
darkhttpd/1.12, copyright (c) 2003-2016 Emil Mikulic.
listening on: http://0.0.0.0:80/
2020-04-30 17:01:12,996:INFO:__main__:1406: Generating new certificate private key
2020-04-30 17:01:46,068:ERROR:__main__:1388: CA marked some of the authorizations as invalid, which likely means it could not access http://example.com/.well-known/acme-challenge/X. Did you set correct path in -d example.com:path or --default_root? Are all your domains accessible from the internet? Please check your domains' DNS entries, your host's network/firewall setup and your webserver config. If a domain's DNS entry has both A and AAAA fields set up, some CAs such as Let's Encrypt will perform the challenge validation over IPv6. If your DNS provider does not answer correctly to CAA records request, Let's Encrypt won't issue a certificate for your domain (see https://letsencrypt.org/docs/caa/). Failing authorizations: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4277663330
Challenge validation has failed, see error log.

Debugging tips: -v improves output verbosity. Help is available under --help.
-----> Certificate retrieval failed!
-----> Disabling ACME proxy for taaalk...
[ ok ] Reloading nginx configuration (via systemctl): nginx.service.
       done
root@taaalk:~# 

再次,为便于阅读,以下转载:

2020-04-30 17:01:46,068:ERROR:__main__:1388: CA marked some of the authorizations as invalid, which likely means it could not access http://example.com/.well-known/acme-challenge/X. Did you set correct path in -d example.com:path or --default_root? Are all your domains accessible from the internet? Please check your domains' DNS entries, your host's network/firewall setup and your webserver config. If a domain's DNS entry has both A and AAAA fields set up, some CAs such as Let's Encrypt will perform the challenge validation over IPv6. If your DNS provider does not answer correctly to CAA records request, Let's Encrypt won't issue a certificate for your domain (see https://letsencrypt.org/docs/caa/). Failing authorizations: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4277663330 Challenge validation has failed, see error log.

我正在使用服务器端CLI来获取我的Web应用程序的SSL(遵循这些说明:https://github.com/dokku/dokku-letsencrypt)。完成设置后,我运行:root @ taaalk:〜#dokku letsencrypt ...

ssl dns lets-encrypt dokku
1个回答
0
投票

修复非常简单。首先,我为www都记录了A。并以我的网址的根目录指向我的服务器。

© www.soinside.com 2019 - 2024. All rights reserved.