#!/bin/bash # Thomas Chung (tchung@openwebmail.org) # make sure to run from /etc/httpd/conf directory # prepare cd /etc/httpd/conf rm -rf ssl.key/server.key rm -rf ssl.crt/server.crt # create a key without password /usr/bin/openssl genrsa 1024 > /etc/httpd/conf/ssl.key/server.key chmod 600 /etc/httpd/conf/ssl.key/server.key # create a test certificate make testcert # restart web server service httpd restart echo "Now check https://$HOSTNAME/cgi-bin/openwebmail/openwebmail.pl" echo "to see your self-signed certificate works!"