MQTT + letsencrypt behind a router

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: trebuen.selfhost.eu

I ran this command:
sudo certbot certonly --standalone --preferred-challenges http-01 -d trebuen.selfhost.eu

It produced this output:
WARNING: The standalone specific supported challenges flag is deprecated.
Please use the --preferred-challenges flag instead.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices) (Enter ‘c’ to
cancel):roland.neubert@nbt-comtec.de


Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory

(A)gree/©ancel: A
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for trebuen.selfhost.eu
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. trebuen.selfhost.eu (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://trebuen.selfhost.eu/.well-known/acme-challenge/XXXX---XXXX: Error getting validation data

IMPORTANT NOTES:

  • If you lose your account credentials, you can recover through
    e-mails sent to roland.neubert@nbt-comtec.de.

  • The following errors were reported by the server:

    Domain: trebuen.selfhost.eu
    Type: connection
    Detail: Fetching
    http://trebuen.selfhost.eu/.well-known/acme-challenge/XXXX---XXXX:
    Error getting validation data

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A 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.

  • Your account credentials have been saved in your Certbot
    configuration directory at /etc/letsencrypt. You should make a
    secure backup of this folder now. This configuration directory will
    also contain certificates and private keys obtained by Certbot so
    making regular backups of this folder is ideal.

My web server is (include version): mosquitto version 1.4.0, build 2019-02-13, no web server

The operating system my web server runs on is (include version):
Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): certbot 0.10.2

I want to use and run mosquitto in Principe according to that tutorial:

Running a selfsigned certificate inside my subnet works. I would liek to have the raspi reside behind the router (Fritz.box 7490) using port forwarding for port 8883. Unecrypted usage works properly on 1883. I can ping my domain address (trebuen.selfhost.eu) fom the raspi without problems.

What little piece is missing to get it running?

Best regards

Roland

You have to get port 80 on your external IP port forwarded to the host where Certbot runs.

That’s the fixed requirement for HTTP-01 validation to succeed.

If port 80 is already in use (forwarded to some other device or served by the router itself), and can’t even be proxied to the raspi, you may have to try using another authentication method.
[Like DNS auth]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.