![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(C) Transition from Http.GetServerSslCert to Http.GetServerCertSee more HTTP ExamplesProvides instructions for replacing deprecated GetServerSslCert method calls with GetServerCert.Note: This example requires Chilkat v11.0.0 or greater.
#include <C_CkHttp.h> #include <C_CkCert.h> void ChilkatSample(void) { HCkHttp http; const char *domain; int port; HCkCert cert1; HCkCert cert2; BOOL success; http = CkHttp_Create(); domain = "chilkatsoft.com"; port = 443; // ------------------------------------------------------------------------ // The GetServerSslCert method is deprecated: cert1 = CkHttp_GetServerSslCert(http,domain,port); if (CkHttp_getLastMethodSuccess(http) == FALSE) { printf("%s\n",CkHttp_lastErrorText(http)); CkHttp_Dispose(http); return; } printf("%s\n",CkCert_subjectDN(cert1)); CkCert_Dispose(cert1); // ------------------------------------------------------------------------ // Do the equivalent using GetServerCert. // Your application creates a new, empty certificate object which is passed // in the last argument and filled with the server certificate upon success. cert2 = CkCert_Create(); success = CkHttp_GetServerCert(http,domain,port,cert2); if (success == FALSE) { printf("%s\n",CkHttp_lastErrorText(http)); CkHttp_Dispose(http); CkCert_Dispose(cert2); return; } printf("%s\n",CkCert_subjectDN(cert2)); CkHttp_Dispose(http); CkCert_Dispose(cert2); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.