(Go) 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.
imap := Imap_Ref.html">chilkat.NewImap()
// ...
// ...
// ------------------------------------------------------------------------
// The GetSslServerCert method is deprecated:
certObj := imap.GetSslServerCert()
if imap.LastMethodSuccess() == false {
fmt.Println(imap.LastErrorText())
imap.DisposeImap()
return
}
// ...
// ...
certObj.DisposeCert()
// ------------------------------------------------------------------------
// Do the equivalent using GetServerCert.
// Your application creates a new, empty Cert_Ref.html">Cert object which is passed
// in the last argument and filled upon success.
cert := Cert_Ref.html">chilkat.NewCert()
success := imap.GetServerCert(cert)
if success == false {
fmt.Println(imap.LastErrorText())
imap.DisposeImap()
cert.DisposeCert()
return
}
imap.DisposeImap()
cert.DisposeCert()
|