Connection Refused when issuing new certificate


My domain is:

I ran this command: sudo certbot certonly --standalone -d

It produced this output:
Failed authorization procedure. (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching Connection refused


My web server is (include version): Nginx 1.14.0
The operating system my web server runs on is (include version): Ubuntu 18.04 LTS

My hosting provider, if applicable, is: Microsoft Azure

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): yes (azure portal)

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


Hi @dss

if you use --standalone, certbot starts an own webserver to anser the request of /.well-known/acme-challenge/file-with-random-name.

Looks that this doesn’t work - connection refused.

But checking your domain ( )

Domainname Http-Status redirect Sec. G 200 0.400 H -2 1.640 V
ConnectFailure - Unable to connect to the remote server No connection could be made because the target machine actively refused it 404 0.430 A
Not Found

the result is good. Port 80 is open, /.well-known/acme-challenge/unknown-file sends the expected http status 404 - Not Found.

X-Powered-By: Express

Do you have a webroot?

If yes, use it:

certbot run -a webroot certonly -w yourWebRoot -d


following your suggestion, we have tried the steps outlined in this documentation:

but still got the same error Connection refused

Any thoughts?


Create a file in /.well-known/acme-challenge, file name 1234 and try to load this file with your browser:


i have created the file and upload it. however when i try to access it, i got connection refused as well


Oh, checking

with my browser -> connection refused.

Is there a firewall? Or has your webserver problems handling http errors?

My earlier window loading

in my browser showed

Error: Failed to lookup view "error" in views directory "/home/adminapp/diabetic-backend/views"
    at Function.render (/home/adminapp/diabetic-backend/node_modules/express/lib/application.js:580:17)
    at ServerResponse.render (/home/adminapp/diabetic-backend/node_modules/express/lib/response.js:1008:7)
    at app.use (/home/adminapp/diabetic-backend/server.js:59:9)
    at Layer.handle_error (/home/adminapp/diabetic-backend/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:315:13)
    at /home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:335:12)
    at next (/home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:275:10)
    at app.use (/home/adminapp/diabetic-backend/server.js:48:5)
    at Layer.handle [as handle_request] (/home/adminapp/diabetic-backend/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:317:13)
    at /home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:335:12)
    at next (/home/adminapp/diabetic-backend/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/home/adminapp/diabetic-backend/node_modules/serve-static/index.js:121:7)
    at emitOne (events.js:116:13)
    at SendStream.emit (events.js:211:7)
    at SendStream.error (/home/adminapp/diabetic-backend/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/home/adminapp/diabetic-backend/node_modules/send/index.js:421:12)
    at next (/home/adminapp/diabetic-backend/node_modules/send/index.js:736:16)
    at onstat (/home/adminapp/diabetic-backend/node_modules/send/index.js:725:14)
    at FSReqWrap.oncomplete (fs.js:152:21)

So it looks that your error handling was wrong - and now it returns a refused.


i have opened the port 80 and 443 as well. so i think firewall is not the issue anymore.

when it shows error: failed to lookup view “error” that must be my false error handling. you dont have to worry about it. I have turn off the server and it should not show this output anymore.

from what I know, I need to turn off the server first so certbot can bind the 80 port. Is this right?


Now I can’t connect your server.

If you use standalone, yes, you have to stop your running webserver. But then it’s impossible to check your configuration, because this is a temporary running webserver.

So using a running webserver and webroot allows better debugging and tests.

closed #9

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