Always print detailed cert errors in test programs

Previously the client was only printing them on handshake success, and
the server was printing them on success and some but not all failures.

This makes ssl-opt.sh more consistent as we can always check for the
presence of the expected message in the output, regardless of whether
the failure is hard or soft.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh
index 895d8fc..6956805 100755
--- a/tests/ssl-opt.sh
+++ b/tests/ssl-opt.sh
@@ -7736,7 +7736,7 @@
             -c "Processing of the Certificate handshake message failed" \
             -C "Ciphersuite is TLS-" \
             -c "send alert level=2 message=43" \
-            -C "! Usage does not match the keyUsage extension"
+            -c "! Usage does not match the keyUsage extension"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
 run_test    "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail, soft" \
@@ -7771,7 +7771,7 @@
             -c "Processing of the Certificate handshake message failed" \
             -C "Ciphersuite is TLS-" \
             -c "send alert level=2 message=43" \
-            -C "! Usage does not match the keyUsage extension"
+            -c "! Usage does not match the keyUsage extension"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
 run_test    "keyUsage cli 1.2: DigitalSignature, RSA: fail, soft" \
@@ -7822,7 +7822,7 @@
             -c "Processing of the Certificate handshake message failed" \
             -C "Ciphersuite is" \
             -c "send alert level=2 message=43" \
-            -C "! Usage does not match the keyUsage extension"
+            -c "! Usage does not match the keyUsage extension"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
 requires_openssl_tls1_3_with_compatible_ephemeral
@@ -7837,7 +7837,7 @@
             -c "Processing of the Certificate handshake message failed" \
             -C "Ciphersuite is" \
             -c "send alert level=2 message=43" \
-            -C "! Usage does not match the keyUsage extension"
+            -c "! Usage does not match the keyUsage extension"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
 requires_openssl_tls1_3_with_compatible_ephemeral
@@ -7864,7 +7864,7 @@
             -c "Processing of the Certificate handshake message failed" \
             -C "Ciphersuite is" \
             -c "send alert level=2 message=43" \
-            -C "! Usage does not match the keyUsage extension"
+            -c "! Usage does not match the keyUsage extension"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
 requires_openssl_tls1_3_with_compatible_ephemeral
@@ -7879,7 +7879,7 @@
             -c "Processing of the Certificate handshake message failed" \
             -C "Ciphersuite is" \
             -c "send alert level=2 message=43" \
-            -C "! Usage does not match the keyUsage extension"
+            -c "! Usage does not match the keyUsage extension"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
 # Tests for keyUsage in leaf certificates, part 3:
@@ -7916,6 +7916,7 @@
             1 \
             -s "bad certificate (usage extensions)" \
             -s "send alert level=2 message=43" \
+            -s "! Usage does not match the keyUsage extension" \
             -s "Processing of the Certificate handshake message failed"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
@@ -7948,6 +7949,7 @@
             1 \
             -s "bad certificate (usage extensions)" \
             -s "send alert level=2 message=43" \
+            -s "! Usage does not match the keyUsage extension" \
             -s "Processing of the Certificate handshake message failed"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
 
@@ -7999,6 +8001,7 @@
             -s "bad certificate (usage extensions)" \
             -s "Processing of the Certificate handshake message failed" \
             -s "send alert level=2 message=43" \
+            -s "! Usage does not match the keyUsage extension" \
             -s "! mbedtls_ssl_handshake returned"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
             #
@@ -8040,6 +8043,7 @@
             -s "bad certificate (usage extensions)" \
             -s "Processing of the Certificate handshake message failed" \
             -s "send alert level=2 message=43" \
+            -s "! Usage does not match the keyUsage extension" \
             -s "! mbedtls_ssl_handshake returned"
             # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT
             #