patch-doc_mkcert_sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. $OpenBSD: patch-doc_mkcert_sh,v 1.8 2016/12/04 21:36:02 sthen Exp $
  2. --- doc/mkcert.sh.orig Tue Nov 29 17:35:50 2016
  3. +++ doc/mkcert.sh Tue Nov 29 20:53:21 2016
  4. @@ -6,19 +6,13 @@
  5. umask 077
  6. OPENSSL=${OPENSSL-openssl}
  7. SSLDIR=${SSLDIR-/etc/ssl}
  8. -OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}
  9. +OPENSSLCONFIG=${OPENSSLCONFIG-${SSLDIR}/dovecot-openssl.cnf}
  10. -CERTDIR=$SSLDIR/certs
  11. KEYDIR=$SSLDIR/private
  12. -CERTFILE=$CERTDIR/dovecot.pem
  13. +CERTFILE=$SSLDIR/dovecotcert.pem
  14. KEYFILE=$KEYDIR/dovecot.pem
  15. -if [ ! -d $CERTDIR ]; then
  16. - echo "$SSLDIR/certs directory doesn't exist"
  17. - exit 1
  18. -fi
  19. -
  20. if [ ! -d $KEYDIR ]; then
  21. echo "$SSLDIR/private directory doesn't exist"
  22. exit 1
  23. @@ -34,7 +28,7 @@ if [ -f $KEYFILE ]; then
  24. exit 1
  25. fi
  26. -$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 365 || exit 2
  27. +$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 730 || exit 2
  28. chmod 0600 $KEYFILE
  29. echo
  30. $OPENSSL x509 -subject -fingerprint -noout -in $CERTFILE || exit 2