2010-03-23 17:32:07 -04:00
|
|
|
$OpenBSD: patch-doc_mkcert_sh,v 1.7 2010/03/23 21:32:07 pea Exp $
|
|
|
|
--- doc/mkcert.sh.orig Wed Jan 7 13:33:25 2009
|
|
|
|
+++ doc/mkcert.sh Sun Dec 27 01:03:53 2009
|
|
|
|
@@ -5,19 +5,13 @@
|
2003-07-14 19:44:28 -04:00
|
|
|
|
|
|
|
OPENSSL=${OPENSSL-openssl}
|
|
|
|
SSLDIR=${SSLDIR-/etc/ssl}
|
|
|
|
-OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}
|
|
|
|
+OPENSSLCONFIG=${OPENSSLCONFIG-${SSLDIR}/dovecot-openssl.cnf}
|
|
|
|
|
2006-07-15 22:43:08 -04:00
|
|
|
-CERTDIR=$SSLDIR/certs
|
|
|
|
KEYDIR=$SSLDIR/private
|
2006-06-19 07:49:07 -04:00
|
|
|
|
2006-07-15 22:43:08 -04:00
|
|
|
-CERTFILE=$CERTDIR/dovecot.pem
|
|
|
|
+CERTFILE=$SSLDIR/dovecotcert.pem
|
|
|
|
KEYFILE=$KEYDIR/dovecot.pem
|
2010-03-23 17:32:07 -04:00
|
|
|
|
2006-07-15 22:43:08 -04:00
|
|
|
-if [ ! -d $CERTDIR ]; then
|
2004-05-09 20:06:47 -04:00
|
|
|
- echo "$SSLDIR/certs directory doesn't exist"
|
2006-07-15 22:43:08 -04:00
|
|
|
- exit 1
|
2003-07-14 19:44:28 -04:00
|
|
|
-fi
|
2010-03-23 17:32:07 -04:00
|
|
|
-
|
2006-07-15 22:43:08 -04:00
|
|
|
if [ ! -d $KEYDIR ]; then
|
2004-05-09 20:06:47 -04:00
|
|
|
echo "$SSLDIR/private directory doesn't exist"
|
2010-03-23 17:32:07 -04:00
|
|
|
exit 1
|
|
|
|
@@ -33,7 +27,7 @@ if [ -f $KEYFILE ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
-$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 365 || exit 2
|
|
|
|
+$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 730 || exit 2
|
|
|
|
chmod 0600 $KEYFILE
|
|
|
|
echo
|
|
|
|
$OPENSSL x509 -subject -fingerprint -noout -in $CERTFILE || exit 2
|