Is is possible to write a Sparkle server that requires all connections to provide a valid client certificate? I have registered my SSL port binding so that 'Negotiate Client Certificate' is enabled, but I can't see where to add code to my server to read and validate a client certificate.
procedure(const C: THttpServerContext)
var
CertInfo: PHTTP_SSL_CLIENT_CERT_INFO;
SslInfo: PHTTP_SSL_INFO;
begin
SslInfo := THttpSysContext(C).SysRequest.RawRequest.pSslInfo;
if SslInfo <> nil then CertInfo := SslInfo^.pClientCertInfo;
// CertInfo contains client certificate info
end
Well, side note: Actually SysRequest is not public property. We have changed it here in our development code, but you can simply make it public there in your code (unit Sparkle.HttpSys.Context) and recompile Sparkle packages: