propertyTsmCustomRESTClient.TLSEngine
property TLSEngine: TsmSimpleTLSInternalServer read fTLSEngine write SetTLSEngine;
THE TLS ENGINE THIS CLIENT RUNS ON, supplied and OWNED BY THE CALLER.
Assign one - and keep it for the life of the client - when calls REPEAT. The engine carries the trust store, and the trust store is also the cache the revocation check consults before fetching: a CRL fetched during one call is FOUND by the next instead of being fetched again. With no engine assigned and trust of our own to install, each exchange creates and destroys its own, so every call pays the fetch. That cost lands on the call a user is waiting for.
It stays the caller's engine. This client configures it (see the warning below) but never frees it, and clears this property if it is destroyed first.
NIL, AND NO TRUST OF OUR OWN (no OnConfigureTrust, no ExtraAnchorFile, HasPrivateTrust False), MEANS GlobalServer - the process-wide outbound store. That is a REAL trust decision, not a fallback to nothing: whatever GlobalServer trusts, this client then trusts. A REST endpoint that needs its own anchors must either wire OnConfigureTrust (which gets it a private engine) or assign one here. See the unit header.
WARNING - WITH BOTH THIS AND OnConfigureTrust ASSIGNED, THE ENGINE HANDED TO OnConfigureTrust IS THIS ONE, NOT A TEMPORARY. *** The handler is mutating a long-lived component that the caller owns and may share with other clients, so anchors it adds PERSIST and are visible to everything else using that engine. That is the point when the engine is dedicated to this destination, and a trust-domain leak when it is not - one engine per trust domain, never one shared across destinations that should not vouch for each other. The handler runs ONCE per engine - on the first exchange any client makes through it, however many clients share the engine and on however many threads - not once per call and not once per client, so it need not be idempotent; a client that reaches the engine while the handler is running waits for it to return before it connects. But the handler must not assume it is being handed a blank engine to scribble on. An install that raises is not recorded, so the next exchange through that engine runs the handler again.
CLIENTS THAT SHARE AN ENGINE SHARE ITS TRUST. The client that makes the first exchange installs its OnConfigureTrust anchors, its ExtraAnchorFile and its RevocationChecking on the engine; a later client on the same engine installs nothing of its own there. Pointing this property at an engine no exchange has been made through yet installs this client's.