  		IF(NOT OPENSSL_FOUND)
  		    MESSAGE(FATAL_ERROR "Requested OpenSSL SHA1 backend, but OpenSSL could not be found")
  		ENDIF()
-@@ -323,7 +341,11 @@ ENDIF()
+@@ -323,7 +342,11 @@ ENDIF()
  
  # Optional external dependency: zlib
  IF(NOT USE_BUNDLED_ZLIB)

 	IF (ENABLE_REPRODUCIBLE_BUILDS)
 		SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 213dd79..f8ebaaf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,11 +19,21 @@ SET(LIBGIT2_INCLUDES

 
 # Set a couple variables to be substituted inside the .pc file.
 # We can't just use LIB_INSTALL_DIR in the .pc file, as passing them as absolue
@@ -141,7 +151,12 @@ ENDIF()
 
 IF (USE_HTTPS)
 	# We try to find any packages our backends might use
-	FIND_PACKAGE(OpenSSL)
+	IF(OPENSSL_MODULE_PATH)
+		FIND_PACKAGE(usexp-OpenSSL REQUIRED PATHS ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
+		GET_TARGET_PROPERTY(OPENSSL_INCLUDE_DIR externpro::crypto INTERFACE_INCLUDE_DIRECTORIES)
+	ELSE()
+		FIND_PACKAGE(OpenSSL)
+	ENDIF()
 	FIND_PACKAGE(mbedTLS)
 	IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 		FIND_PACKAGE(Security)
@@ -262,7 +277,11 @@ ENDIF()
 # Specify sha1 implementation
 IF(SHA1_BACKEND STREQUAL "OpenSSL")
 	IF(NOT OPENSSL_FOUND)
