docker-mailserver/target/bin/generate-ssl-certificate

14 lines
490 B
Plaintext
Raw Normal View History

#!/bin/sh
2016-07-12 15:40:08 +00:00
FQDN=$(hostname --fqdn)
2015-08-18 18:43:42 +00:00
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
2015-12-05 18:08:39 +00:00
cat /ssl/$FQDN-key.pem /ssl/$FQDN-cert.pem > /ssl/$FQDN-combined.pem