Sample code for 30+ languages & platforms
Lazarus Pascal

Require that the Web Server's SSL Certificate is Non-Expired and the Signature is Valid

Demonstrates setting the RequireSslCertVerify property to require that the web server's SSL/TLS certificate is non-expired and that the certificate's signature is valid.

Chilkat Lazarus Pascal Downloads

Lazarus Pascal
program ChilkatDemo;

// Demonstrates using the Chilkat Pascal wrapper via the C bridge DLL.
// Builds as a console application under Lazarus (FPC) or Delphi.

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}

uses
  {$IFDEF UNIX}
  cthreads,
  {$ENDIF}
  SysUtils,
  CkDllLoader,
  Chilkat.Http;

// ---------------------------------------------------------------------------

procedure RunDemo;
var
  url: string;
  http: THttp;
  html: string;

begin
  //  This example assumes the Chilkat HTTP API to have been previously unlocked.
  //  See Global Unlock Sample for sample code.

  url := 'https://chilkatsoft.com';

  http := THttp.Create;
  http.RequireSslCertVerify := True;

  html := http.QuickGetStr(url);
  if (http.LastMethodSuccess <> True) then
    begin
      WriteLn(http.LastErrorText);
      Exit;
    end;

  WriteLn('Success.');


  http.Free;

end;

// ---------------------------------------------------------------------------

begin

  try
    RunDemo;
  except
    on E: Exception do
      WriteLn('Unhandled exception: ', E.ClassName, ': ', E.Message);
  end;

  WriteLn;
  {$IFDEF MSWINDOWS}
  WriteLn('Press Enter to exit...');
  ReadLn;
  {$ENDIF}
end.