Sample code for 30+ languages & platforms
Node.js

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var http = new chilkat.Http();
    var cert = new chilkat.Cert();

    success = http.GetServerCert("chilkatsoft.com",443,cert);
    if (success == false) {
        console.log(http.LastErrorText);
        return;
    }

    console.log(cert.SubjectDN);
    console.log(cert.ValidToStr);

    //  Output:

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

}

chilkatExample();