(Objective-C) Transition from Imap.GetSslServerCert to Imap.GetServerCert
Provides instructions for replacing deprecated GetSslServerCert method calls with GetServerCert. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoImap.h>
#import <CkoCert.h>
CkoImap *imap = [[CkoImap alloc] init];
// ...
// ...
// ------------------------------------------------------------------------
// The GetSslServerCert method is deprecated:
CkoCert *certObj = [imap GetSslServerCert];
if (imap.LastMethodSuccess == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using GetServerCert.
// Your application creates a new, empty Cert object which is passed
// in the last argument and filled upon success.
CkoCert *cert = [[CkoCert alloc] init];
BOOL success = [imap GetServerCert: cert];
if (success == NO) {
NSLog(@"%@",imap.LastErrorText);
return;
}
|