diff options
Diffstat (limited to 'Swiften/StreamStack/PlatformTLSLayerFactory.cpp')
-rw-r--r-- | Swiften/StreamStack/PlatformTLSLayerFactory.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Swiften/StreamStack/PlatformTLSLayerFactory.cpp b/Swiften/StreamStack/PlatformTLSLayerFactory.cpp new file mode 100644 index 0000000..bb1abf1 --- /dev/null +++ b/Swiften/StreamStack/PlatformTLSLayerFactory.cpp @@ -0,0 +1,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 +} + +TLSLayer* PlatformTLSLayerFactory::createTLSLayer() { +#ifdef HAVE_OPENSSL + return new OpenSSLLayer(); +#else + assert(false); + return 0; +#endif +} + +} |