]>
Commit | Line | Data |
---|---|---|
6946a3be CMN |
1 | /* |
2 | * Copyright (C) the libgit2 contributors. All rights reserved. | |
3 | * | |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
6 | */ | |
7 | ||
8 | #include "git2/errors.h" | |
9 | #include "common.h" | |
10 | ||
11 | #include "openssl_stream.h" | |
12 | #include "stransport_stream.h" | |
13 | ||
14 | int git_tls_stream_new(git_stream **out, const char *host, const char *port) | |
15 | { | |
16 | #ifdef GIT_SECURE_TRANSPORT | |
17 | return git_stransport_stream_new(out, host, port); | |
24e53d2f | 18 | #elif defined(GIT_OPENSSL) |
6946a3be CMN |
19 | return git_openssl_stream_new(out, host, port); |
20 | #else | |
21 | GIT_UNUSED(out); | |
22 | GIT_UNUSED(host); | |
23 | GIT_UNUSED(port); | |
24 | ||
25 | giterr_set(GITERR_SSL, "there is no TLS stream available"); | |
26 | return -1; | |
27 | #endif | |
28 | } |