Something interesting I found elsewhere....
Now for a small caveat - this all assumes your certificate was signed by a root certificate authority. In some cases, the CA which signed your certificate is not a root CA, but is a CA signed by a CA (or signed by a CA who was signed by a CA who is a root CA, etc.) This is often known as a chained certificate, or a ca-bundle.
What makes things tricky is that the remote client will look at your certificate, and try to verify it against the root CAs it knows about. If there is an intermediate CA between you and the CA the client knows about, it will need this certificate to sucessfully verify your certificate. As such, the server needs to not only provide clients with its own certificate, but also those of the intermediate CAs.
In the UW-IMAP server, this is achieved by appending all intermediate certificates to the file containing your own certificate, with the highest-level certificate last. (The root certificate is not required, as the client already has it.) With this information added, your imapd.pem now looks like this:
-----BEGIN RSA PRIVATE KEY-----
ABCDEF......
rest of key encoded here
....XYZ==
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
ABCDE......
rest of certificate encoded here
....XYZ=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
ABCDE......
rest of intermediate certificate used to sign previous one encoded here
(i.e. the certificate of your CA, which is itself signed by a root CA)
....XYZ=
-----END CERTIFICATE-----
Now, SMEserver 7 uses sslio to do the secure imap stuff.
Have a look here...
/var/service/imaps/run
and
/var/service/imap/ssl/imapd.pem
The question is how does imapd.pem get created?