Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTsmCustomTLSInternalServer.ReplaceTLSServerCertificate

procedure ReplaceTLSServerCertificate(const aCert: iCertificate; const aPriv: iMPPrivateKey); overload;
Use this method for replacing a server certificate assigned by TLSSetupServer, without having to close the server and reload all keys and certificates from file. The new certificate must have been added to MyCerts prior to the call to ReplaceTLSServerCertificate, e.g. by a call to ImportFromPFX - that is the normal path, and any issuer CAs the exported chain needs must be in the store regardless. (Corner case: if the leaf was NOT pre-added, the call will file it into MyCerts itself, after verifying aPriv is its private key. That is a safety net for an internal edge case, not a contract for consumer code to rely on.) Server-side only: it swaps the cached leaf/private-key entry that the 1.2 and 1.3 server handshake paths select from, so existing sessions are unaffected but new handshakes pick up aCert immediately (zero-downtime certificate rollover, e.g. after ACME renewal).
procedure ReplaceTLSServerCertificate(const aCert: iCertificate; const aPriv: iMPPrivateKey; const aRetired: array of iCertificate); overload;
As above, and every leaf in aRetired is retired (see TsmStreamSecII): no longer served, not served again by TLSSetupServer and no longer counted by ValidatePublicKeyPairs.