diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2021-08-11 01:30:38 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-08-12 23:08:19 +0100 |
commit | e9c4caa8f4b5a004c56189a6f83395f809e8cbf8 (patch) | |
tree | b2847f96fc1c72463741caa31a10a7b1f67433eb /src/streams/openssl.h | |
parent | 806778dc482e40d26bc7a9d44ccd18b888f6ec33 (diff) | |
download | libgit2-ethomson/ssl_refactor.tar.gz |
openssl: dynamically load libssl and symbols (optionally)ethomson/ssl_refactor
Provide an interface around OpenSSL to dynamically load the libraries and symbols,
so that users can distribute a libgit2 library that is not linked directly against
OpenSSL. This enables users to target multiple distributions with a single binary.
This mechanism is optional and disabled by default. Configure cmake with
-DUSE_HTTPS=OpenSSL-Dynamic to use it.
Diffstat (limited to 'src/streams/openssl.h')
-rw-r--r-- | src/streams/openssl.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/streams/openssl.h b/src/streams/openssl.h index 826d1efbc..89fb60a82 100644 --- a/src/streams/openssl.h +++ b/src/streams/openssl.h @@ -8,14 +8,22 @@ #define INCLUDE_streams_openssl_h__ #include "common.h" +#include "streams/openssl_legacy.h" +#include "streams/openssl_dynamic.h" #include "git2/sys/stream.h" extern int git_openssl_stream_global_init(void); +#if defined(GIT_OPENSSL) && !defined(GIT_OPENSSL_DYNAMIC) +# include <openssl/ssl.h> +# include <openssl/err.h> +# include <openssl/x509v3.h> +# include <openssl/bio.h> +# endif + #ifdef GIT_OPENSSL extern int git_openssl__set_cert_location(const char *file, const char *path); - extern int git_openssl_stream_new(git_stream **out, const char *host, const char *port); extern int git_openssl_stream_wrap(git_stream **out, git_stream *in, const char *host); #endif |