Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1549,10 +1549,12 @@ TLS_LIBS="-framework Foundation $TLS_LIBS" TLS_LIBS="-framework Security $TLS_LIBS" AC_SUBST(OF_SECURE_TRANSPORT_TLS_STREAM_M, "OFSecureTransportTLSStream.m") + + AC_CHECK_FUNCS(SSLCreateContext) ], []) LIBS="$old_LIBS" ]) Index: src/tls/OFSecureTransportTLSStream.m ================================================================== --- src/tls/OFSecureTransportTLSStream.m +++ src/tls/OFSecureTransportTLSStream.m @@ -12,10 +12,12 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFSecureTransportTLSStream.h" #import "OFAlreadyConnectedException.h" #import "OFNotOpenException.h" @@ -117,11 +119,15 @@ [_host release]; _host = nil; SSLClose(_context); +#ifdef HAVE_SSLCREATECONTEXT CFRelease(_context); +#else + SSLDisposeContext(_context); +#endif _context = NULL; [super close]; } @@ -182,12 +188,16 @@ OSStatus status; if (_context != NULL) @throw [OFAlreadyConnectedException exceptionWithSocket: self]; +#ifdef HAVE_SSLCREATECONTEXT if ((_context = SSLCreateContext(kCFAllocatorDefault, kSSLClientSide, kSSLStreamType)) == NULL) +#else + if (SSLNewContext(false, &_context) != noErr) +#endif @throw [OFTLSHandshakeFailedException exceptionWithStream: self host: host errorCode: initFailedErrorCode];