Fix embarrassing X.509 bug introduced in 9533765
diff --git a/library/x509_crt.c b/library/x509_crt.c
index d4ef82e..d9f25ed 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -1647,6 +1647,9 @@
     x509_crt *grandparent;
     const md_info_t *md_info;
 
+    if( x509_time_expired( &child->valid_to ) )
+        *flags |= BADCERT_EXPIRED;
+
     if( x509_time_future( &child->valid_from ) )
         *flags |= BADCERT_FUTURE;