diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,25 @@
+2021-09-29  Vladimir Shabanov  <dev@vshabanov.com>
+
+	* HsOpenSSL.cabal (Version): Bump version to 0.11.7.2
+
+	* Fixed OpenSSL 3.0 linking errors (#62)
+
 2021-07-28  Vladimir Shabanov  <dev@vshabanov.com>
 
 	* HsOpenSSL.cabal (Version): Bump version to 0.11.7.1
 
 	* Fix SSL_CTX_set_session_id_context #61
 	by @flobrosch (#61)
+
+
+2021-04-19  Vladimir Shabanov  <dev@vshabanov.com>
+
+	* HsOpenSSL.cabal (Version): Bump version to 0.11.7
+
+	* Added Session.contextSetDefaultVerifyPaths
+	by Alexander Biehl @alexbiehl (#59)
+
+	* Fix for LibreSSL (#58)
 
 2021-04-05  Vladimir Shabanov  <dev@vshabanov.com>
 
diff --git a/HsOpenSSL.cabal b/HsOpenSSL.cabal
--- a/HsOpenSSL.cabal
+++ b/HsOpenSSL.cabal
@@ -10,7 +10,7 @@
     systems and stable. You may also be interested in the @tls@ package,
     <http://hackage.haskell.org/package/tls>, which is a pure Haskell
     implementation of SSL.
-Version:       0.11.7.1
+Version:       0.11.7.2
 License:       PublicDomain
 License-File:  COPYING
 Author:        Adam Langley, Mikhail Vorozhtsov, PHO, Taru Karttunen
diff --git a/OpenSSL/Cipher.hsc b/OpenSSL/Cipher.hsc
--- a/OpenSSL/Cipher.hsc
+++ b/OpenSSL/Cipher.hsc
@@ -1,3 +1,6 @@
+#include "HsOpenSSL.h"
+#include "openssl/aes.h"
+
 {-# LANGUAGE EmptyDataDecls           #-}
 {-# LANGUAGE ForeignFunctionInterface #-}
 -- | This module interfaces to some of the OpenSSL ciphers without using
@@ -21,8 +24,7 @@
 #endif
     )
     where
-#include "HsOpenSSL.h"
-#include "openssl/aes.h"
+
 import           Control.Monad (when, unless)
 import           Data.IORef
 import           Foreign
diff --git a/OpenSSL/EVP/PKey.hsc b/OpenSSL/EVP/PKey.hsc
--- a/OpenSSL/EVP/PKey.hsc
+++ b/OpenSSL/EVP/PKey.hsc
@@ -50,13 +50,13 @@
     toKeyPair (SomeKeyPair pk) = cast pk
 
 
-getType :: Ptr EVP_PKEY -> IO CInt
 
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
-foreign import ccall unsafe "EVP_PKEY_base_id"
-        _base_id :: Ptr EVP_PKEY -> IO CInt
-getType = _base_id
+#if OPENSSL_VERSION_PREREQ(3,0)
+foreign import ccall unsafe "EVP_PKEY_get_base_id" getType :: Ptr EVP_PKEY -> IO CInt
+#elif OPENSSL_VERSION_NUMBER >= 0x10100000L
+foreign import ccall unsafe "EVP_PKEY_base_id" getType :: Ptr EVP_PKEY -> IO CInt
 #else
+getType :: Ptr EVP_PKEY -> IO CInt
 getType = (#peek EVP_PKEY, type)
 #endif
 
diff --git a/OpenSSL/Session.hsc b/OpenSSL/Session.hsc
--- a/OpenSSL/Session.hsc
+++ b/OpenSSL/Session.hsc
@@ -79,7 +79,7 @@
 
   ) where
 
-#include "openssl/ssl.h"
+#include "HsOpenSSL.h"
 
 import Prelude hiding (
 #if !MIN_VERSION_base(4,6,0)
@@ -523,11 +523,13 @@
   (#const SSL_ERROR_WANT_CONNECT) -> "SSL_ERROR_WANT_CONNECT"
   (#const SSL_ERROR_WANT_ACCEPT) -> "SSL_ERROR_WANT_ACCEPT"
   (#const SSL_ERROR_WANT_X509_LOOKUP) -> "SSL_ERROR_WANT_X509_LOOKUP"
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#if defined(SSL_ERROR_WANT_ASYNC)
   (#const SSL_ERROR_WANT_ASYNC) -> "SSL_ERROR_WANT_ASYNC"
+#endif
+#if defined(SSL_ERROR_WANT_ASYNC_JOB)
   (#const SSL_ERROR_WANT_ASYNC_JOB) -> "SSL_ERROR_WANT_ASYNC_JOB"
 #endif
-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
+#if defined(SSL_ERROR_WANT_CLIENT_HELLO_CB)
   (#const SSL_ERROR_WANT_CLIENT_HELLO_CB) -> "SSL_ERROR_WANT_CLIENT_HELLO_CB"
 #endif
   (#const SSL_ERROR_SYSCALL) -> "SSL_ERROR_SYSCALL"
@@ -765,8 +767,11 @@
                                        else
                                          return $ SSLDone ()
                            _   -> throwSSLException "SSL_shutdown" err n
-
+#if OPENSSL_VERSION_PREREQ(3,0)
+foreign import ccall "SSL_get1_peer_certificate" _ssl_get_peer_cert :: Ptr SSL_ -> IO (Ptr X509_)
+#else
 foreign import ccall "SSL_get_peer_certificate" _ssl_get_peer_cert :: Ptr SSL_ -> IO (Ptr X509_)
+#endif
 
 -- | After a successful connection, get the certificate of the other party. If
 --   this is a server connection, you probably won't get a certificate unless
diff --git a/cbits/HsOpenSSL.h b/cbits/HsOpenSSL.h
--- a/cbits/HsOpenSSL.h
+++ b/cbits/HsOpenSSL.h
@@ -38,6 +38,13 @@
 #define OPENSSL_VERSION_NUMBER 0x1000107fL
 #endif
 
+/* OpenSSL 3.0 ****************************************************************/
+
+#ifndef OPENSSL_VERSION_PREREQ
+#define OPENSSL_VERSION_PREREQ(maj,min) 0
+#endif
+
+
 /* OpenSSL ********************************************************************/
 void HsOpenSSL_init();
 void HsOpenSSL_OPENSSL_free(void* ptr);
