/* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include #include #include #include #ifdef HAVE_OPENSSL #include #include #endif #ifdef HAVE_SCHANNEL #include #include #endif #ifdef HAVE_SECURETRANSPORT #include #include #endif namespace Swift { PlatformTLSFactories::PlatformTLSFactories() : contextFactory(nullptr), certificateFactory(nullptr) { #ifdef HAVE_OPENSSL contextFactory = new OpenSSLContextFactory(); certificateFactory = new OpenSSLCertificateFactory(); #endif #ifdef HAVE_SCHANNEL contextFactory = new SchannelContextFactory(); certificateFactory = new SchannelCertificateFactory(); #endif #ifdef HAVE_SECURETRANSPORT contextFactory = new SecureTransportContextFactory(); certificateFactory = new SecureTransportCertificateFactory(); #endif } PlatformTLSFactories::~PlatformTLSFactories() { delete contextFactory; delete certificateFactory; } TLSContextFactory* PlatformTLSFactories::getTLSContextFactory() const { return contextFactory; } CertificateFactory* PlatformTLSFactories::getCertificateFactory() const { return certificateFactory; } }