@@ -29,10 +29,11 @@ #import "OFNumber.h" #import "OFRunLoop.h" #import "OFSocket+Private.h" #import "OFString.h" #import "OFTCPSocket.h" +#import "OFTLSSocket.h" #import "OFURL.h" #import "OFAlreadyConnectedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidArgumentException.h" @@ -697,16 +698,17 @@ [_client close]; if ([URL.scheme caseInsensitiveCompare: @"https"] == OFOrderedSame) { - if (OFTLSSocketClass == Nil) + @try { + sock = [OFTLSSocket socket]; + port = 443; + } @catch (OFNotImplementedException *e) { @throw [OFUnsupportedProtocolException exceptionWithURL: URL]; - - sock = [[[OFTLSSocketClass alloc] init] autorelease]; - port = 443; + } } else { sock = [OFTCPSocket socket]; port = 80; }