diff options
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/scripts/cert-staple.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/scripts/cert-staple.sh b/doc/scripts/cert-staple.sh index af0c5c13..09f7bb3a 100755 --- a/doc/scripts/cert-staple.sh +++ b/doc/scripts/cert-staple.sh @@ -46,7 +46,14 @@ ocsp_status="$(printf %s "$OCSP_RESP" | head -1)" next_update="$(printf %s "$OCSP_RESP" | grep 'Next Update:')" next_date="$(printf %s "$next_update" | sed 's/.*Next Update: //')" [ -n "$next_date" ] || errexit -ocsp_expire=$(date -d "$next_date" +%s) +sysname=$(uname -s) +if [ "$sysname" = "FreeBSD" ] || \ + [ "$sysname" = "OpenBSD" ] || \ + [ "$sysname" = "DragonFly" ]; then + ocsp_expire=$(date -j -f "%b %e %T %Y %Z" "$next_date" "+%s") +else + ocsp_expire=$(date -d "$next_date" +%s) +fi # validate OCSP response ocsp_verify=$(openssl ocsp -issuer "$CHAIN_PEM" -verify_other "$CHAIN_PEM" -cert "$CERT_PEM" -respin "$OCSP_TMP" -no_nonce -out /dev/null 2>&1) |