(Unicode 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.
#include <C_CkHttpW.h>
void ChilkatSample(void)
{
const wchar_t *url;
HCkHttpW http;
const wchar_t *html;
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
url = L"https://chilkatsoft.com";
http = CkHttpW_Create();
CkHttpW_putRequireSslCertVerify(http,TRUE);
html = CkHttpW_quickGetStr(http,url);
if (CkHttpW_getLastMethodSuccess(http) != TRUE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
return;
}
wprintf(L"Success.\n");
CkHttpW_Dispose(http);
}
|