Openssl oneliners

Generate a private key

openssl genrsa -out ssl.key 1024

Generate a self-signed certificate

openssl req -new -x509 -days 3650 -key ssl.key -out ssl.crt

Verification

openssl x509 -in ssl.crt -text -noout

Checking certificate validity (put this in your .bashrc)

alias cert-check="openssl s_client -CApath /etc/ssl/certs/ -connect $1"
alias cert-check-date="ssl-check-date $1"
function ssl-check-date ()
{
openssl s_client -CApath /etc/ssl/certs/ -connect $1 2>/dev/null | 
openssl x509 -noout -dates
}