Flask SSL Configuration while using Nginx

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: devamsizliktakip.com

I ran this command: sudo certbot certonly --nginx

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.


1: devamsizliktakip.info.tr
2: www.devamsizliktakip.info.tr


Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for devamsizliktakip.info.tr and www.devamsizliktakip.info.tr

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: devamsizliktakip.info.tr
Type: unauthorized
Detail: 31.223.116.176: Invalid response from http://devamsizliktakip.info.tr/.well-known/acme-challenge/u0Os7z65nEfi5LCPw38fqnmJ0ISxzDWGajpk7qgSqYU: 404

Domain: www.devamsizliktakip.info.tr
Type: unauthorized
Detail: 31.223.116.176: Invalid response from http://www.devamsizliktakip.info.tr/.well-known/acme-challenge/sXrltsW9lLugk-dxchgUt45MpC4i5x_f7m4GeJ-kYCs: 404

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

Some challenges have failed.

My web server is (include version): Python Flask app deployed with waitress

The operating system my web server runs on is (include version): Debian GNU/Linux 12 (bookworm) (virtualbox)

My hosting provider, if applicable, is: I don't think this matters. It successfully redirects.

I can login to a root shell on my machine (yes or no, or I don't know): I am able to execute commands in terminal with root access if this is what is being asked.

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

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 3.2.0 (I am unable to use)

Things that i feel i should mention:
I can access my website from my mobile phone.
Some friend of mine can not reach while some can.
If i use http:// , I can reach while https:// returns error.
I think this http(s):// situation causes this
That's why i am trying to get SSL certificate

The --nginx option only works when an nginx server replies to HTTP requests.

I see your waitress server replying. You should use the --webroot method instead. See: User Guide — Certbot 4.0.0.dev0 documentation

Does this sound like a solution to your problem?

2 Likes

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