diff --git a/ssl.c b/ssl.c
index 07d7aa5..45df34f 100644
--- a/ssl.c
+++ b/ssl.c
@@ -225,7 +225,7 @@ rdssl_rkey_get_exp_mod(RDSSL_RKEY * rkey, uint8 * exponent, uint32 max_exp_len,
 	BIGNUM *e = NULL;
 	BIGNUM *n = NULL;
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L  || defined(LIBRESSL_VERSION_NUMBER))
 	e = rkey->e;
 	n = rkey->n;
 #else
-- 
2.20.1

