-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Certbot fails to generate Let's Encrypt certs on the first attempt #173
Comments
Example error message on new installs:
This is strange, because unless the Certbot team has carelessly written their error messages (unlikely) then it means the verification tests for both And because SlickStack runs over HTTPS by default and has HSTS enabled by default, the HTTP verification is going to fail which means we need a way to tell Certbot to run the tests over |
As per this discussion, the Our |
Hey. I can confirm the issue still exists (even after running the installation multiple times + a reboot). Just got a brand new server instance and tried installing SlickStack (Now using KVM at Hetzner.de). Kind regards. Maybe it would be possible to provide SlickStack with "Full SSL Strict" enabled, using the SSL certs you can create directly under CloudFlare instead of having self-signed certificates through letsencrypt? |
So part of my confusion was discussing this issue with the Lets Encrypt community, who maybe were unaware of some Certbot-specific issues, specifically that port 80 is still required. I also failed to properly specify how SlickStack was integrating Certbot with our Nginx configuration and server blocks, i.e. only port 443 for canonical. But after confirming HSTS was not an issue, and thoroughly discussing this and reviewing dozens of forum threads, Stack Exchange threads, blog posts, and beyond... I think this is the cause: Ref: https://letsencrypt.org/docs/allow-port-80/
Since SlickStack only allows port 80 on the catch-all Nginx server block (which is not domain-matched), then Certbot is very likely "hanging" because SlickStack doesn't 301 redirect those requests to HTTPS via port 80. In other words, simply redirecting HTTP to HTTPS via Cloudflare or Nginx is not enough... If we don't want to change our Nginx configuration, we would have to use Ref: https://community.letsencrypt.org/t/which-client-support-tls-alpn-challenge/75859 And for the record, this is not impossible, but it's more involved than I would hope for really: |
TLDR I'm not entirely opposed to ditching Certbot for another ACME client, however, because Certbot is sponsored by EFF among other established organizations, there's perhaps stronger trust and longevity with their project... and Certbot is already supported in the Ubuntu packages and such. What if Certbot or Nginx begin supporting |
Update: adding the below snippet to production, staging, and development server blocks seems to have improved things, and the "404 Not Found" error is no longer returned by Certbot on brand new servers:
However, there was still a 52x error returned by Certbot on my last attempt on a virgin SlickStack server, this might be related to the Linux kernel issue we've been discussing separately. |
I checked the Nginx access log, there was no attempt by Certbot shown until the 2nd install, which was:
So there's no longer 404 errors, but timeout errors like 522 instead. I assume this means Nginx is not even properly active at the time of the first attempts... |
Changed server blocks a bit:
Now getting "Timeout during connect (likely firewall problem)" but port 80 scan shows fine. Not sure if IPv6 related, however in the Certbot logs it shows the connection attempt was to the IPv4 address so should be unrelated... Really blows my mind how finicky Certbot is, not sure we should keep using it. |
This has been an ongoing issue for several months, and it's confusing many new users.
We discovered that because many users who are new to SlickStack and LEMP don't realize that OpenSSL works fine and is much easier esp. when behind Cloudflare, they have apparently been choosing the
letsencrypt
option during setup, seeing that error, and assuming SlickStack doesn't work and then ditching it altogether.After feedback on this confusion in our Discord chat room, we decided to default to
openssl
going forward AND hide the option from the setup wizard to avoid frustrating newbies.However, this doesn't solve the issue of Certbot failing to issue the certificates on the first attempt, which seems to happen on virgin installations. The first time you run
ss-install
on a brand new server, everything tends to work fine except for Certbot, which "hangs" and then returns an "unauthorized" error... however, after runningss-install
again, the certificates are issued properly with a SUCCESS message.We've tried for a while to figure out what's causing this... we suspected it was IPv6 / Cloudflare related because of several other related cases on the forums and around the web, but it might be this:
Ref: https://webdock.io/en/docs/webdock-control-panel/ssl-certificate-guides/common-certbot-errors
I can personally confirm this issue still happens even when choosing the "Full SSL" setting in Cloudflare SSL tab, and even when IPv6 exists in the DNS records and resolves in the Nginx server, so this seems unrelated:
Ref: https://support.plesk.com/hc/en-us/articles/360016816274-Could-not-issue-a-Let-s-Encrypt-certificate-DNS-zone-contains-an-AAAA-record-but-the-domain-is-not-assigned-an-IPv6-address-in-Plesk
The text was updated successfully, but these errors were encountered: