Fixes #14 with SSL configuration

This commit is contained in:
Thomas VIAL 2015-08-18 20:43:42 +02:00
parent 4de6cea033
commit ea830f5ec6
3 changed files with 24 additions and 7 deletions

View file

@ -1,4 +1,17 @@
#!/bin/sh
FQDN=$(hostname)
openssl req -new -newkey rsa:2048 -nodes -keyout /ssl/$FQDN.key -out /ssl/$FQDN.csr
cd /ssl
# Create CA certificate
/usr/lib/ssl/misc/CA.pl -newca
# Create an unpassworded private key and create an unsigned public key certificate
openssl req -new -nodes -keyout /ssl/$FQDN-key.pem -out /ssl/$FQDN-req.pem -days 3652
# Sign the public key certificate with CA certificate
openssl ca -out /ssl/$FQDN-cert.pem -infiles /ssl/$FQDN-req.pem
# Combine certificates for courier
cat /ssl/$FQDN-key.pem /ssl/$FQDN-cert.pem >> /ssl/$FQDN-combined.pem
# chmod 644 /etc/postfix/foo-cert.pem /etc/postfix/cacert.pem
# chmod 400 /etc/postfix/foo-key.pem