Your issue is not with UW imapd, but rather with SSL certificates. For more detailed help, you should check on a mailing list or newsgroup dedicated to OpenSSL and/or certificate issues.
The procedure that you gave: openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 3650 is the procedure for making a self-signed certificate. You probably don't want that; you need a real certificate from a certificate authority (CA). In any case, that procedure for making a self-signed certificate prompts you for the Common Name, which must be the same as the DNS name of the server. If you thought that was supposed to be your name, well, that's all the more reason why you should buy a real certificate instead of using self-signed certificates. Unfortunately, the easiest certificates to get are the ones which are the most dangerous for novices.
