Sample code for 30+ languages & platforms
C

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 C Downloads

C
#include <C_CkHttp.h>

void ChilkatSample(void)
    {
    const char *url;
    HCkHttp http;
    const char *html;

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

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

    http = CkHttp_Create();
    CkHttp_putRequireSslCertVerify(http,TRUE);

    html = CkHttp_quickGetStr(http,url);
    if (CkHttp_getLastMethodSuccess(http) != TRUE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        return;
    }

    printf("Success.\n");


    CkHttp_Dispose(http);

    }