Sha256: 9797e69d6b6f942964ef3fdefa6b0852c0e56a66bf2e8c255de599551543f66c

Contents?: true

Size: 878 Bytes

Versions: 7

Compression:

Stored size: 878 Bytes

Contents

/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */

#include "streams/tls.h"

#include "git2/errors.h"

#include "streams/openssl.h"
#include "streams/stransport.h"

static git_stream_cb tls_ctor;

int git_stream_register_tls(git_stream_cb ctor)
{
	tls_ctor = ctor;

	return 0;
}

int git_tls_stream_new(git_stream **out, const char *host, const char *port)
{

	if (tls_ctor)
		return tls_ctor(out, host, port);

#ifdef GIT_SECURE_TRANSPORT
	return git_stransport_stream_new(out, host, port);
#elif defined(GIT_OPENSSL)
	return git_openssl_stream_new(out, host, port);
#else
	GIT_UNUSED(out);
	GIT_UNUSED(host);
	GIT_UNUSED(port);

	giterr_set(GITERR_SSL, "there is no TLS stream available");
	return -1;
#endif
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rugged-0.27.10.1 vendor/libgit2/src/streams/tls.c
rugged-0.27.9 vendor/libgit2/src/streams/tls.c
rugged-0.27.5 vendor/libgit2/src/streams/tls.c
rugged-0.27.4 vendor/libgit2/src/streams/tls.c
rugged-0.27.2 vendor/libgit2/src/streams/tls.c
rugged-0.27.1 vendor/libgit2/src/streams/tls.c
rugged-0.27.0 vendor/libgit2/src/streams/tls.c