methodTsmAcmeRenewalManager.TryBeginRenewal
function TryBeginRenewal(out aHold: iAcmeRenewalHold): Boolean;
TryBeginRenewal brackets a MANUAL obtain - one the application issues on this manager's client itself - with exactly the gates this manager's own renewals take, in the same order, so a hand-driven ObtainCertificate cannot overlap a scheduled renewal:
if FMgr.TryBeginRenewal(lHold) then try FAcme.ObtainCertificate; finally
lHold := nil; // releases every gate it took end;
Releasing is what dropping the reference does - there is nothing to pair by hand, nothing to leak if the obtain raises, and nothing that can be released twice. Release it on the thread that took it.
NON-BLOCKING. It polls briefly and then gives up rather than pinning the caller's thread, which is often the VCL main thread. False means either the gates are busy - do NOT obtain, try again later - or this thread is already inside an obtain, which is a bug rather than something to wait for.
USE THIS INSTEAD OF the server's own TryBeginAcmeChallenge. That gate covers one server; this also covers the ACME account key and the host's own challenge responder, and it still works when the client has no server at all.