Changeset 47b10e9 for tests


Ignore:
Timestamp:
May 8, 2014 5:56:37 PM (6 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
cfdbef0
Parents:
1b5a2dd
Message:

checkremotecerts.sh: explicit check that cert exists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/scripts/checkremotecerts.sh

    r1b5a2dd r47b10e9  
    6666        # 1) the the CN in the certificate doesn't match the hostname.
    6767        # 2) the certificate is invalid
    68         openssl x509 -in "$CERTHOME/ssl/$HOST.crt" -fingerprint -noout > "$WORK/$HOST.expected.finger"
    69         openssl x509 -in "$WORK/$HOST.test" -fingerprint -noout > "$WORK/$HOST.real.finger"
    70         if [ "$(cat "$WORK/$HOST.expected.finger")" != "$(cat "$WORK/$HOST.real.finger")" ]; then
    71             echo -n "invalid certificate for $HOST"
     68        if [ -e "$CERTHOME/ssl/$HOST.crt" ]; then
     69            openssl x509 -in "$CERTHOME/ssl/$HOST.crt" -fingerprint -noout > "$WORK/$HOST.expected.finger"
     70            openssl x509 -in "$WORK/$HOST.test" -fingerprint -noout > "$WORK/$HOST.real.finger"
     71            if [ "$(cat "$WORK/$HOST.expected.finger")" != "$(cat "$WORK/$HOST.real.finger")" ]; then
     72                echo -n "invalid certificate for $HOST"
     73                FAIL=1
     74                echo $HOST >> $WORK/bad
     75            fi
     76        else
     77            echo "Untrusted certficate and certificate not found at $CERTHOME/ssl" >&2
    7278            FAIL=1
    7379            echo $HOST >> $WORK/bad
Note: See TracChangeset for help on using the changeset viewer.