openssl req -x509 -nodes -days 3650 -subj '/C=CA/ST=QC/L=Montreal/O=Company Name/CN=server.name.com' -newkey rsa:1024 -keyout new_key.pem -out new_cert.pemAnd there you have it.
OpenSSL Self-Signed Certificate one-liner.
Ok, this is a purely selfish post. I have to do this rarely enough that every time I do, I have to look it up. I could put this somewhere, perhaps in my little bag of tricks called ‘you should remember this’. Unfortunately, I don’t have that bag, and I’ll never remember it. So, hopefully putting this here will give me one more place to forget, and just maybe someone else will find it useful too. A handy little one-line command to generate cert and keys in PEM format that Dovecot will like: