Sample code for 30+ languages & platforms
Tcl

Transition from Imap.GetSslServerCert to Imap.GetServerCert

Provides instructions for replacing deprecated GetSslServerCert method calls with GetServerCert.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set imap [new_CkImap]

# ...
# ...

# ------------------------------------------------------------------------
# The GetSslServerCert method is deprecated:

# certObj is a CkCert
set certObj [CkImap_GetSslServerCert $imap]
if {[CkImap_get_LastMethodSuccess $imap] == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    exit
}

# ...
# ...

delete_CkCert $certObj

# ------------------------------------------------------------------------
# Do the equivalent using GetServerCert.
# Your application creates a new, empty Cert object which is passed 
# in the last argument and filled upon success.

set cert [new_CkCert]

set success [CkImap_GetServerCert $imap $cert]
if {$success == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    delete_CkCert $cert
    exit
}


delete_CkImap $imap
delete_CkCert $cert