With my Nokia 9300, I'm having a problem getting IMAP/SSL to work without getting the "Security Warning - You have received and untrusted certificate....' every time I check mail. It's very dissruptive to have to click OK every time I want to check for email, send or read an email.
I've downloaded and installed the certificate in the certificate in the 'Certificate Manager' and set the trust settings to 'Secure Networking = Yes', but that doesn't help.
IIRC The problem is that the certificate itself has expired, unsigned, or is invalid for other reasons (such as domain name for example). Your IMAP server should be configured with a new cert. If its your IMAP server, you can get free signed certs from the net somewhere. not sure where.