Problem solved. I was having this issue with all of my servers. Every server I entered, despite the fact that there was a certificate present, was returning an error. Just for kicks, I tried entering the server without the "imap" prefix. So, instead of using 'imap.gmail.com', I just used 'gmail.com' for the SSL server. It returned different IP addresses for the servers. I did this for each account and have had no errors since. Everything is syncing properly, including iCloud. The only thing that isn't working is sending email with the iCloud @me.com account, but I don't think that issue is related. Notes and everything else, however, are syncing fine across all accounts.