(Swift) 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.
func chilkatTest() {
let imap = CkoImap()!
// ...
// ...
// ------------------------------------------------------------------------
// The GetSslServerCert method is deprecated:
var certObj: CkoCert? = imap.getSslServerCert()
if imap.lastMethodSuccess == false {
print("\(imap.lastErrorText!)")
return
}
// ...
// ...
certObj = nil
// ------------------------------------------------------------------------
// Do the equivalent using GetServerCert.
// Your application creates a new, empty Cert object which is passed
// in the last argument and filled upon success.
let cert = CkoCert()!
var success: Bool = imap.getServer(cert)
if success == false {
print("\(imap.lastErrorText!)")
return
}
}
|