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.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Runs an HTTP server locally which serves the necessary validation files under
the /.well-known/acme-challenge/ request path. Suitable if there is no HTTP
server already running. HTTP challenge only (wildcards not supported).
(standalone)
2: Saves the necessary validation files to a .well-known/acme-challenge/
directory within the nominated webroot path. A seperate HTTP server must be
running and serving files from the webroot path. HTTP challenge only (wildcards
not supported). (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Requesting a certificate for lawrence-sanzogni.com and www.lawrence-sanzogni.com
Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
Domain: lawrence-sanzogni.com
Type: unauthorized
Detail: 3.134.161.84: Invalid response from http://lawrence-sanzogni.com/.well-known/acme-challenge/bFTq0syd2SurkjDxqfsqo_qO8AmGpv7KAFQcMYc8JcY: "<!DOCTYPE html>\n<html lang=\"en\">\n <head charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1"
Domain: www.lawrence-sanzogni.com
Type: unauthorized
Detail: 3.134.161.84: Invalid response from http://www.lawrence-sanzogni.com/.well-known/acme-challenge/8bql4YO23z_QGxamewGaDYilVYxK_u6OL581Q7ewaWo: "<!DOCTYPE html>\n<html lang=\"en\">\n <head charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1"
Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.
My web server is (include version): Chrome
The operating system my web server runs on is (include version): Ubuntu 22.04.1 LTS
My hosting provider, if applicable, is: AWS
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):
AWS
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.7.4
You have an "Express" web service responding to HTTP (port 80) requests. You must stop that before using --standalone which needs exclusive use of port 80.
Or, use the webroot method and specify the document root used by your express service.
You could also consider a DNS Challenge. Certbot has a Route53 plugin although requires some care to set the permissions correctly. See the Certbot docs for that.
Thank you for the response. If I stop my express server from running, then I get another error
Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
Domain: lawrence-sanzogni.com
Type: connection
Detail: 3.134.161.84: Fetching http://lawrence-sanzogni.com/.well-known/acme-challenge/4RwRXPVJAOg1dJF-b5deks92TMXZD6Ci3u2bvhcZoOw: Connection refused
Domain: www.lawrence-sanzogni.com
Type: connection
Detail: 3.134.161.84: Fetching http://www.lawrence-sanzogni.com/.well-known/acme-challenge/DPwDLdYSiw6azWHySSOOA3qUsv0v9PLU8gdqk4gTdZs: Connection refused
Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.
the same error message appears if I keep the server running but change port numbers
Certbot will pause with a "press enter" or similar. Leave it paused - do Not press Enter. While paused open a different window or device to connect to the URL it will show you. You could even try a simple curl to your domain while it is paused. You should be able to get a response. If it works from inside your AWS VPC make sure to try from the public internet (even a cell phone with wifi off).
If possible, still while Certbot is paused, try this in another window to that EC2 instance
So I did this:
I have 3 terminal windows open - each one connected to my EC2 instance via ssh....
#1 is running my express server nodemon server.js
#2 is running the debug option: sudo certbot certonly --standalone --dry-run --debug-challenges -v -d lawrence-sanzogni.com -d www.lawrence-sanzogni.com
it is PAUSED.
Well, the HTTP request that arrives from Let's Encrypt on port 80 must reach Certbot --standalone. With your port forwarding I don't see how that can work. You can tell --standalone to listen on a different port but then you need to change your forward to that port. But, if you were going to do that just disable the forward while --standalone running
I think you are better off trying to get --webroot working with Express or maybe even better is the DNS Challenge. That takes out all the comms routing from the picture.
It is not ideal to return 200 when 404 is better. But, for the HTTP Challenge to succeed all Express has to do is return the contents of the file created by Certbot in the path you tell it.
I don't know Express at all but this might be the right value for the --webroot-path (you will need to test) although make it explicit if you can at least while testing.
Unfortunately, I'm now running into the issue where my server can't find the pem files using the given filepaths.
Does anyone have some insight to this?
This issue is becoming a bit too elaborate with new problems presenting themselves. My original question was indeed answered. I assume nobody wants this thread to veer off topic so I'll give a brief explanation then make another thread if necessary.
My application is written in Nodejs, so I'll post excerpts of the bare essentials just to show how my server works as this community focuses on LetsEncrypt specific issues.
My Express server is running and it appears to have accepted my certificates now, evidenced that it executes the code nested in the try statement and not the error handler. And proceeds to log my console commands:
listening to localhost:8443
When I run a curl command to my website it still results that PEM files can't be found