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. crt.sh | 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: aseilasoft.cl
I ran this command: sudo certbot --apache
It produced this output: Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1,5
Requesting a certificate for aseilasoft.cl and www.aseilasoft.cl
Performing the following challenges:
http-01 challenge for aseilasoft.cl
http-01 challenge for www.aseilasoft.cl
Enabled Apache rewrite module
Waiting for verification...
Challenge failed for domain aseilasoft.cl
Challenge failed for domain www.aseilasoft.cl
http-01 challenge for aseilasoft.cl
http-01 challenge for www.aseilasoft.cl
Cleaning up challenges
Some challenges have failed.
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.
My web server is (include version): Apache/2.4.29 (Ubuntu)
The operating system my web server runs on is (include version): Ubuntu 18.04.5 LTS
My hosting provider, if applicable, is: Hetzner
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 1.13.0
The same error happens
sergio@aseilasoft:/etc/apache2/sites-enabled$ sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
1: aseilasoft.cl
2: www.aseilasoft.cl
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 2
Requesting a certificate for aseilasoft.cl and www.aseilasoft.cl
Performing the following challenges:
http-01 challenge for aseilasoft.cl
http-01 challenge for www.aseilasoft.cl
Enabled Apache rewrite module
Waiting for verification...
Challenge failed for domain aseilasoft.cl
Challenge failed for domain www.aseilasoft.cl
http-01 challenge for aseilasoft.cl
http-01 challenge for www.aseilasoft.cl
Cleaning up challenges
Some challenges have failed.
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.
If your iptables is rerouting port 80 to port 8080, your Apache, which is listening on port 80 too, wouldn't work at all.. But as Apache is working properly on port 80 (just not certbot), that's unlikely?
Well, I think you've got a rather non-standard setup. For example, if I look at the headers returned by your webserver, I see:
Server: Werkzeug/0.11.15 Python/3.6.9
Usually, Apache returns with, well, "Apache" and its version. It seems "Werkzeug" can be used through a module in Apache called mod_wsgi. This is all rather non-standard, so it all might interfere with certbot.
sergio@aseilasoft:/etc/apache2/sites-available$ tail -f /var/log/odoo/odoo-server.log
2021-03-23 20:30:28,944 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Partner Autocomplete : Sync with remote DB.
2021-03-23 20:30:28,961 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Partner Autocomplete : Sync with remote DB done.
2021-03-23 20:30:28,963 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Snailmail: process letters queue.
2021-03-23 20:30:28,974 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Snailma il: process letters queue done.
2021-03-23 20:44:07,720 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Calendar: Event Reminder.
2021-03-23 20:44:07,749 7231 INFO aseilasoft odoo.modules.registry: At least one model cac he has been invalidated, signaling through the database.
2021-03-23 20:44:07,753 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Calenda r: Event Reminder done.
2021-03-23 21:14:31,342 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Calendar: Event Reminder.
2021-03-23 21:14:31,391 7231 INFO aseilasoft odoo.modules.registry: At least one model cac he has been invalidated, signaling through the database.
2021-03-23 21:14:31,396 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Calenda r: Event Reminder done.
2021-03-23 21:30:32,229 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Mail: Email Queu e Manager.
2021-03-23 21:30:32,249 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Mail: Email Queue Manager done.
2021-03-23 21:30:32,251 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Partner Autocomp lete : Sync with remote DB.
2021-03-23 21:30:32,264 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Partner Autocomplete : Sy nc with remote DB done.
2021-03-23 21:30:32,266 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Snailmail: proce ss letters queue.
2021-03-23 21:30:32,282 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Snailmail: process letter s queue done.
2021-03-23 21:37:39,020 7231 INFO aseilasoft werkzeug: 157.245.89.85 - - [23/Mar/2021 21:37:39] "GET /track/ HTTP/1.1" 404 - 356 0.277 0.561
2021-03-23 21:44:10,088 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Starting job Calendar: Event Reminder.
2021-03-23 21:44:10,131 7231 INFO aseilasoft odoo.modules.registry: At least one model cache has been invali dated, signaling through the database.
2021-03-23 21:44:10,136 7231 INFO aseilasoft odoo.addons.base.models.ir_cron: Job Calendar: Event Reminder done.
2021-03-23 21:45:10,472 7231 INFO aseilasoft werkzeug: 205.185.122.102 - - [23/Mar/2021 21:45:10] "GET /conf ig/getuser?index=0 HTTP/1.1" 404 - 356 0.289 0.596
I think the problem here really is you're not running Apache as the webserver, but (as I understand from your earlier post) just Werkzeug on port 8080, which explains the 80 -> 8080 redirect in iptables.
I'm not sure if there is a straight way to get a certificate with Werkzeug directly, as certbot doesn't interface with it, like it does with Apache or nginx. Also, I'm not sure if the built in webserver you're using for Werkzeug has the capability to serve files from disk, i.e., a webroot, so the webroot method might also be not an option.
Further more, from the link you've pasted earlier about Werkzeug, it seems the built in webserver option mentioned there is just for one connection type: HTTP OR HTTPS. Not both!
This all clearly is very limited. IMO the best option is to put a webserver in front of Werkzeug, which is configured as a reverse proxy and will take care of all the HTTPS stuff, so that Werkzeug can run without HTTPS, but the connection to it, through the reverse proxy, is still secure.
Apache and nginx can be configured as a reverse proxy for this, but those are relative large applications for such a simple job. HAProxy can also do this job and is more suited for it IMO, as it's not a complete webserver, but the experience with it is less on this Community, so we probably wouldn't be able to help you with it that quickly.
Also note that Werkzeug is a WSGI application, so you might want to look into specific WSGI reverse proxies.