summaryrefslogtreecommitdiff
path: root/apache2/cron-daily/local-apache2-ocsp
blob: 95d0ba5e55ec5403b7adbc60d186e061f303778b (plain)
  1. #!/bin/sh
  2. #
  3. # local daily cron script to prefetch OCSP data for apache2 mod_gnutls
  4. set -eu
  5. # collect OCSP responses here
  6. CACHEDIR=/var/cache/apache2/ocsp
  7. command -v ocsptool > /dev/null || exit 0
  8. mkdir -p "$CACHEDIR"
  9. chown www-data: "$CACHEDIR"
  10. runuser -u www-data -- \
  11. find /etc/ssl/shared -name '*.chain.pem' -exec \
  12. sh -c 'stem=$(basename --suffix=.chain.pem '"'{}'"') && ocsptool --ask --no-nonce --load-chain '"'{}'"' --outfile "'"$CACHEDIR"'/$stem.der" > /dev/null 2>&1' ';'