Sample code for 30+ languages & platforms
Perl

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Perl Downloads

Perl
use chilkat();

$success = 0;

$http = chilkat::CkHttp->new();
$cert = chilkat::CkCert->new();

$success = $http->GetServerCert("chilkatsoft.com",443,$cert);
if ($success == 0) {
    print $http->lastErrorText() . "\r\n";
    exit;
}

print $cert->subjectDN() . "\r\n";
print $cert->validToStr() . "\r\n";

# Output:

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