Closed Nihimia closed 7 months ago
Hi,
A little update on this one. I got ride of the nginx reload hourly by editing certificate.js like this :
const cmd = certbotCommand + ' renew ' +
'--config "' + certbotConfig + '" ' +
'--preferred-challenges "dns,http" ' +
'--no-random-sleep-on-renew';
return utils.exec(cmd)
.then((result) => {
if (result.includes('No renewals were attempted.')) {
logger.info('No renewals were attempted');
} else {
logger.info('Renew Result: ' + result);
return internalNginx.reload()
.then(() => {
logger.info('Renew Complete');
return result;
});
}
})
I removed the --quiet flag, and I look if the result includes the string 'No renewals were attempted.'.
If the the string 'No renewals were attempted.' is met :
[SSL ] › ℹ info Renewing TLS certs close to expiry...
[SSL ] › ℹ info No renewals were attempted
If the the string 'No renewals were attempted.' is not met : :
[SSL ] › ℹ info Renewing TLS certs close to expiry...
[SSL ] › ℹ info Renew Result:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /data/tls/certbot/renewal/npm-1.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Certificate not yet due for renewal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /data/tls/certbot/renewal/npm-2.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Certificate not yet due for renewal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The following certificates are not due for renewal yet:
/data/tls/certbot/live/npm-1/fullchain.pem expires on 2024-05-13 (skipped)
/data/tls/certbot/live/npm-2/fullchain.pem expires on 2024-05-13 (skipped)
No renewals were attempted.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[Nginx ] › ℹ info Reloading Nginx
[SSL ] › ℹ info Renew Complete
Clearly, I don't know if it's the best approach, but hope it can help ! I don't have any certificate to renew before a moment, so I can't test further.
maybe you can read this: https://stackoverflow.com/questions/58228975/how-to-detect-if-theres-any-certificates-renewed-by-certbot-renew - there is no way to detect if an cert was renewed or not
at least nothing which could be used in production
also reloading isn't an issue I don't see why this should be changes and maybe break
Yes, don't know if what I posted is reliable or not, I dropped this just in case.
On the orginal NPM, some people reported issues with hourly nginx reload : https://github.com/NginxProxyManager/nginx-proxy-manager/issues/677
Didn't think of it when I made this issue, but maybe change the interval to something daily rather than hourly maybe better. Don't know if just changing intervalTimeout: 1000 60 60 is sufficent. In my case, checking and reloading hourly for certificate cause a lot of DNS requests to r3.o.lencr.org
I could add an option to change the intervall
will be added in the next release
An oldie. I see the code says the new default is 24 hours (CRT env) however, my system still shows NPMPlus banging on DNS every hour. About 100 times/hour looking for e5.o.lencr.org.
I have 18 hosts defined, 16 with (the same) cert, two without any cert.
e5.o.lencr.org
yes, this is because of ocsp requests, so it is wanted behavior
Maybe time to remove that functionality as it's been deprecated industry-wide.
https://letsencrypt.org/2024/07/23/replacing-ocsp-with-crls
We recommend that anyone relying on OCSP services today start the process of ending that reliance as soon as possible.
Over 11% of the DNS traffic on my network since yesterday.
no
That's cool. I've blocked it anyway. Good luck.
you lowered your security
No, I didn't, because no external source is going to be responsible for the security of my locally hosted services.
if you want no external sources, then don't use letsencrypt and self sign your certificates
Please mark off-topic.
If you believe that disabling the use of OCSP for one's OWN domain(s) and certificates in any way reduces security, then maybe it's time to look for a different reverse proxy implementation.
There is literally no use in validating revocation status for one's own certs since revocation is within one's own control. In addition to being a waste of resources, it sends unencrypted data across the net containing details of the cert and domain(s) which can be intercepted (MITM).
Additionally it doesn't reduce the server's security for servers/ports/domains opened to the outside. Lack of validation may reduce browser trust, but seeing as everyone is now using (or can use) revocation lists, the issue is moot. By the end of the year no one at the CA level nor browser level will even support OCSP at all.
Anyway, easy enough to disable in the configuration file, and it should not be on by default in the first place.
ssl_ocsp off;
Hello,
I've seen that nginx is reloading each hour :
I think it's related to the cert renewal tasks :
Even if there's no certificate to renew, nginx is still reloaded each hour. Is that normal ? Should nginx be reloaded only when a certificate is renewed ?
Again, thank you !