Letsencrypt error

Hallo,

ich versuche für meinen NC Pi in der Fritzbox mit eingerichteter Portfreigabe für IPv4 und IPv6 für 80 und 443 (testweise war auch Exposed Host aktiv) und eingerichtetem MyFritz (dynDNS) ein letsencrypt Zertifikat zu erstellen. Ich besitze eine Domain, wo eine Subdomain auf die MyFritz Adresse zeigt (Subdomain - Type CNAME - TTL 14400 - RDATA zeigt auf MyFritz-Adresse). Rufe ich die Subdomain auf, so gelange ich auch erfolgreich auf die Nextcloud. In der Vergangenheit hatte ich so erfolgreich ein Letsencrypt-Zertifikat aktiv. Neulich habe ich einfach eine neue Nextcloudpi Instanz aufgesetzt, da ich sauber auf den Pi 4 mit 4GB wechseln wollte. (NextCloudPi version v1.16.6
NextCloudPi image NextCloudPi_07-21-19

Ich versuche nun mit den Angaben der Subdomain, meiner Mail und einem NC User im NCP ein Zertifikat zu generieren und erhalte immer folgenden Error:

[ letsencrypt ]
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for SUBDOMAIN
Using the webroot path /var/www/nextcloud for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. SUBDOMAIN (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching https://SUBDOMAIN/.well-known/acme-challenge/st32ZiB28rOYCrYaNmtYoDfocT6zWtFx4i4: Timeout during connect (likely firewall problem)
IMPORTANT NOTES:

  • The following errors were reported by the server:

Domain: SUBDOMAIN
Type: connection
Detail: Fetching
https://SUBDOMAIN/.well-known/acme-challenge/st32ZiB28rOYCrYasNmtYoDfocT6zWtFx4i4:
Timeout during connect (likely firewall problem)

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.

Afaik, the ACME protocol (http-01) uses port 80/tcp to verify a certificate. It seems that you’re forwarding incoming connections on port 80/tcp (http) to port 443/tcp (https) which might be the reason for your problem.

1 Like

Thank yor for this Tip, i had “Force HTTPS” active. After uncheck this in NCP Panel, i got an certificate! But isn’t this a Bug? How can i get automatically the certificate with active function of HTTPS foced?

This is not a bug and works as designed. How should a certificate verification take place if you don’t have a valid certificate for inbound connections? Therefore it is impossible to use https from the beginning.
Once you have a valid certificate it might be possible to change the ACME protocol from “http-01” to “tls-alpn-01”, but to be honest, I don’t know if this mechanism is supported on a RaspberryPi because it requires a specific ALPN responder to answer the certificate verification request and is not only done by switching to the https protocol.

1 Like

So theoretically I can first enable FORCE HTTPS again and would temporarily disable it for the renewal process of the certificate?

This would definitely be a way to go.