summaryrefslogtreecommitdiffstats
blob: 40021ee3967189284e5f762d6c0b6a2cf016c819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Swiften/StreamStack/PlatformTLSLayerFactory.h"

#include <cassert>

#ifdef HAVE_SWIFTEN_CONFIG_H
#include "Swiften/config.h"
#endif
#ifdef HAVE_OPENSSL
#include "Swiften/StreamStack/OpenSSLLayer.h"
#endif

namespace Swift {

PlatformTLSLayerFactory::PlatformTLSLayerFactory() {
}

bool PlatformTLSLayerFactory::canCreate() const {
#ifdef HAVE_OPENSSL
	return true;
#else
	return false;
#endif
}

boost::shared_ptr<TLSLayer> PlatformTLSLayerFactory::createTLSLayer() {
#ifdef HAVE_OPENSSL
	return boost::shared_ptr<TLSLayer>(new OpenSSLLayer());
#else
	assert(false);
	return boost::shared_ptr<TLSLayer>();
#endif
}

}