summaryrefslogtreecommitdiff
path: root/src/libgit2/streams/tls.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-03-06 15:19:29 -0800
committerEdward Thomson <ethomson@vercel.com>2023-03-21 09:09:48 +0000
commitf68f542eb63efb0f50e00d2376196f5bd48ed41e (patch)
treeb027843970124cb02cf2f36a7aa663b311fc76cc /src/libgit2/streams/tls.c
parent1b929b3d8531dbf6326285491e2e17ff4db2c337 (diff)
downloadlibgit2-f68f542eb63efb0f50e00d2376196f5bd48ed41e.tar.gz
http: introduce schannel streams for windows
Provide a stream interface for Schannel - the native crypto APIs - on Windows. This allows Windows to use the same HTTP transport that all the other platforms use, with its own native crypto. Ultimately this allows us to deprecate WinHTTP and we need not add support for our socket changes in two places (our HTTP stack and the WinHTTP stack).
Diffstat (limited to 'src/libgit2/streams/tls.c')
-rw-r--r--src/libgit2/streams/tls.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libgit2/streams/tls.c b/src/libgit2/streams/tls.c
index e063a33f9..246ac9ca7 100644
--- a/src/libgit2/streams/tls.c
+++ b/src/libgit2/streams/tls.c
@@ -13,6 +13,7 @@
#include "streams/mbedtls.h"
#include "streams/openssl.h"
#include "streams/stransport.h"
+#include "streams/schannel.h"
int git_tls_stream_new(git_stream **out, const char *host, const char *port)
{
@@ -33,6 +34,8 @@ int git_tls_stream_new(git_stream **out, const char *host, const char *port)
init = git_openssl_stream_new;
#elif defined(GIT_MBEDTLS)
init = git_mbedtls_stream_new;
+#elif defined(GIT_SCHANNEL)
+ init = git_schannel_stream_new;
#endif
} else {
return error;
@@ -63,6 +66,8 @@ int git_tls_stream_wrap(git_stream **out, git_stream *in, const char *host)
wrap = git_openssl_stream_wrap;
#elif defined(GIT_MBEDTLS)
wrap = git_mbedtls_stream_wrap;
+#elif defined(GIT_SCHANNEL)
+ wrap = git_schannel_stream_wrap;
#endif
}