Sample code for 30+ languages & platforms
Swift Requires Chilkat v11.0.0+

Transition from Imap.GetSslServerCert to Imap.GetServerCert

Provides instructions for replacing deprecated GetSslServerCert method calls with GetServerCert.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    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()!
    success = imap.getServerCert(cert: cert)
    if success == false {
        print("\(imap.lastErrorText!)")
        return
    }


}