diff --git a/lib/https.c b/lib/https.c
index 33c296a..b526add 100644
--- a/lib/https.c
+++ b/lib/https.c
@@ -353,7 +353,7 @@ _establish_connection(struct https_request * const req,
  * building for OpenSSL versions older than 1.1.0
  * or any version of LibreSSL.
  */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x2070000fL
 static HMAC_CTX *
 HMAC_CTX_new(void)
 {