Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTsnipTLSServer.CurrentTransportInfo

class function CurrentTransportInfo: iTLSConnectionInfo;
WHO IS CALLING, FOR A SNIF METHOD RUNNING ON A SNIP-OVER-TLS CONNECTION. A remoted method never sees the connection it arrived on; these two read it from TsnifClassServer.CurrentContext, which belongs to the calling thread for the duration of one call. Both answer nil outside such a call, and on a connection that is not snip over TLS.

function TMySvc.Redeem(...): ...; var lCert: iCertificate; begin lCert := TsnipTLSServer.CurrentPeerCertificate; if (lCert = nil) or not MayRedeem(lCert) then raise ...;

CurrentPeerCertificate is the client's certificate when the TLS server requested one and the client authenticated with it (mTLS): it has passed the engine's trust configuration and the handshake's client- authentication checks, so what is left is AUTHORIZATION. It is nil when the client sent none, after the TLS session has closed, and on a resumed TLS 1.3 session (see TsnipServerTLSOctetConnection.PeerCertificate). CurrentTransportInfo is the whole iTLSConnectionInfo of the connection. Neither is meant to be stored past the call.