This is the script I made a long time ago to generate self-signed certificates. While I was using it recently I realized other people might find it useful. Standard disclaimers apply: never use a self signed cert unless you know what you're doing; use at your own risk -- if it causes any damage, it's not my fault; feel free to use & copy it, just note it's got a BSD 2-clause license; etc.
Lemme know if it works for you or if you think it's missing something. (but remember, it's supposed to be dog simple for generating self signed certs for testing)