简体   繁体   English

nodejs greenlock-express不会创建证书

[英]nodejs greenlock-express wont create certificate

I'm trying the simple greenlock-express example and I've tried many many times but it won't work.我正在尝试简单的greenlock-express 示例,我已经尝试了很多次,但它不起作用。 I followed the tutorial many times.我多次遵循教程。 I created the greenlock.d/config.json file and it works because I see the domain on the output.我创建了greenlock.d/config.json文件,它可以工作,因为我在 output 上看到了域。

When I launch I see:当我启动时,我看到:

webhook_test | Listening on 0.0.0.0:80 for ACME challenges, and redirecting to HTTPS
webhook_test | Listening on 0.0.0.0:443 for secure traffic
webhook_test | Ready to Serve:
webhook_test |   ewkhrwk.xyz

However when I access it with postman, I get但是,当我使用 postman 访问它时,我得到了

webhook_test | ACME Directory URL: https://acme-v02.api.letsencrypt.org/directory
webhook_test | 
webhook_test | By using this software you (me@email.com) are agreeing to the following:
webhook_test | ACME Subscriber Agreement: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
webhook_test | Greenlock/ACME.js Terms of Use: https://rootprojects.org/legal/#terms
webhook_test | 

and it stays like that for minutes.它会保持这种状态几分钟。 Previously when I used greenlock months ago it'd simply generate the certificates in the first access.以前当我几个月前使用 greenlock 时,它只会在第一次访问时生成证书。

After some minutes I get几分钟后,我得到

webhook_test | Error cert_issue:
webhook_test | connect ETIMEDOUT 165.232.74.82:80
webhook_test | code: ETIMEDOUT
webhook_test | Error: connect ETIMEDOUT 165.232.74.82:80
webhook_test |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
webhook_test | Error cert_issue:
webhook_test | connect ETIMEDOUT 165.232.74.82:80
webhook_test | code: ETIMEDOUT
webhook_test | Error: connect ETIMEDOUT 165.232.74.82:80
webhook_test |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
webhook_test | Error cert_issue:
webhook_test | connect ETIMEDOUT 165.232.74.82:80
webhook_test | code: ETIMEDOUT
webhook_test | Error: connect ETIMEDOUT 165.232.74.82:80
webhook_test |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
webhook_test | set greenlockOptions.notify to override the default logger

Is there any update about this issue please?请问这个问题有更新吗? I am safing the same problem.我正在解决同样的问题。

Or is there any way to ignore the certificate?或者有什么办法可以忽略证书?

I've encountered the exact same error when attempting to setup a project that uses greenlock.在尝试设置使用 greenlock 的项目时,我遇到了完全相同的错误。 This is happening because apparently greenlock attempts to access http://example.com from the machine which sets up the certificate.发生这种情况是因为很明显 greenlock 试图从设置证书的机器访问http://example.com

Accessing http://example.com from the internet would result in a reply which looked like this从 Internet 访问http://example.com会得到如下所示的回复

curl -i http://example.com
HTTP/1.1 301 Moved Permanently
Location: https://example.com/
Content-Type: text/html; charset=utf-8
Date: Thu, 14 Jul 2022 13:39:01 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 215
[...]

However the request was timing out when attempting to access http://example.com from the machine on which I was trying to setup the certificate using greenlock.但是,当我尝试从我尝试使用 greenlock 设置证书的机器访问http://example.com时,请求超时。 This was happening because of a network issue, accessing example.com from the internal network won't actually work.这是由于网络问题而发生的,从内部网络访问 example.com 实际上无法正常工作。 How I fixed it was by adding '127.0.0.1 example.com' in the /etc/hosts in order to resolve example.com to the localhost.我如何修复它是通过在 /etc/hosts 中添加“127.0.0.1 example.com”以将 example.com 解析到本地主机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM