diff --git a/tests/scripts/checkcerts.sh b/tests/scripts/checkcerts.sh
index 55820a2133c0663a86aaf15dd567c259dc273f3b..0a0f698722d9e88062c82f33f5add36ad80b08fe 100755
--- a/tests/scripts/checkcerts.sh
+++ b/tests/scripts/checkcerts.sh
@@ -164,6 +164,14 @@ do
     else
        compute_dates
     fi
+    if grep '\s$' $i > /dev/null 2>&1; then
+        echo "********* Trailing whitespace found in file $i *********"
+        FAIL=1
+    fi
+    if grep '^\s' $i > /dev/null 2>&1; then
+        echo "********* Leading whitespace found in file $i *********"
+        FAIL=1
+    fi
 done
 
 if [ -n "$FAIL" ]; then