Sample code for 30+ languages & platforms
Delphi DLL Requires Chilkat v11.0.0+

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Delphi DLL Downloads

Delphi DLL
var
success: Boolean;
http: HCkHttp;
cert: HCkCert;

begin
success := False;

http := CkHttp_Create();
cert := CkCert_Create();

success := CkHttp_GetServerCert(http,'chilkatsoft.com',443,cert);
if (success = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

Memo1.Lines.Add(CkCert__subjectDN(cert));
Memo1.Lines.Add(CkCert__validToStr(cert));

//  Output:

//  CN=*.chilkatsoft.com
//  Wed, 10 Jun 2026 23:59:59 GMT

CkHttp_Dispose(http);
CkCert_Dispose(cert);