SOLVED: Correct way to configure for a proxy?

(sorry not sure what the protocol is on this board, but...)

This was solved by a server reboot. Perhaps the vars hadn't propagated in some way (I was moving to a new VPS).


I have an outbound proxy on my server, but certbot doesn't seem to know about that, despite the proxy vars being in /etc/systemd/system.conf and /etc/environment. Other services on the box are working with that.

If I do a renew --dry-run I get cannot connect errors. If I take the proxy down, I don't.

Does anyone know what the correct way to add the proxy variable is so that certbot can see it? Assuming that's the problem, of course.

EDIT: This seems related? ("http_proxy from /etc/environment not used on Debian")


Ubuntu 22.04
I can login to a root shell on my machine
I'm not using a control panel to manage my site
The version of my client is: certbot 2.6.0 (snap)


EDIT: Here's what I get when the proxy is running:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/alice.hatters.org.uk.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Failed to renew certificate alice.hatters.org.uk with error: Requesting acme-staging-v02.api.letsencrypt.org/directory: Connection refused

Here's what I get when it's not running:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/alice.hatters.org.uk.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Simulating renewal of an existing certificate for www.hatters.org.uk

/etc/environment has:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
http_proxy=http://localhost:8888/
https_proxy=http://localhost:8888/
HTTP_PROXY=http://localhost:8888/
HTTPS_PROXY=http://localhost:8888/

/etc/systemd/system.conf has this line in it:

DefaultEnvironment=https_proxy=http://localhost:8888 http_proxy=http://localhost:8888 HTTPS_PROXY=http://localhost:8888 HTTP_PROXY=http://localhost:8888