(Tcl) 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.
load ./chilkat.dll
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
|