Sample code for 30+ languages & platforms
Unicode C++

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkHttpW.h>
#include <CkCertW.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkHttpW http;
    CkCertW cert;

    success = http.GetServerCert(L"chilkatsoft.com",443,cert);
    if (success == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    wprintf(L"%s\n",cert.subjectDN());
    wprintf(L"%s\n",cert.validToStr());

    //  Output:

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