Sample code for 30+ languages & platforms
PHP ActiveX Requires Chilkat v11.0.0+

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$success = 0;

$http = new COM("Chilkat.Http");
$cert = new COM("Chilkat.Cert");

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

print $cert->SubjectDN . "\n";
print $cert->ValidToStr . "\n";

//  Output:

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

?>