diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c
index 0de589e1639a590f3a994ede03046d29e7e3be55..9b5c7c61cd7e5df86ec66d39a025ec2bf1e10b6e 100644
--- a/lib/vtls/cyassl.c
+++ b/lib/vtls/cyassl.c
@@ -300,7 +300,7 @@ cyassl_connect_step2(struct connectdata *conn,
       }
 #endif
     }
-#ifdef ASN_NO_SIGNER_E /* not present in 2.0.6 */
+#if LIBCYASSL_VERSION_HEX >= 0x02007000 /* 2.7.0 */
     else if(ASN_NO_SIGNER_E == detail) {
       if(data->set.ssl.verifypeer) {
         failf(data, "\tCA signer not available for verification\n");