Sample code for 30+ languages & platforms
Delphi ActiveX

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
http: TChilkatHttp;
cert: TChilkatCert;

begin
success := 0;

http := TChilkatHttp.Create(Self);
cert := TChilkatCert.Create(Self);

success := http.GetServerCert('chilkatsoft.com',443,cert.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add(cert.SubjectDN);
Memo1.Lines.Add(cert.ValidToStr);

// Output:

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