337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
-
+
|
{
void *pool = objc_autoreleasePoolPush();
if (_socket != nil)
@throw [OFAlreadyConnectedException exception];
_socket = [[OFTCPSocket alloc] init];
[_socket setDelegate: self];
[(OFTCPSocket *)_socket setDelegate: self];
if (_server != nil)
[_socket asyncConnectToHost: _server
port: _port];
else
[[OFThread DNSResolver] asyncResolveHost: _domainToASCII
delegate: self];
|
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
|
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
|
-
+
|
[newSock setCertificateFile: _certificateFile];
[newSock setPrivateKeyFile: _privateKeyFile];
[newSock setPrivateKeyPassphrase: _privateKeyPassphrase];
#endif
[newSock startTLSWithExpectedHost: nil];
[_socket release];
_socket = newSock;
[_socket setDelegate: self];
[(OFTCPSocket *)_socket setDelegate: self];
_encrypted = true;
[_delegates broadcastSelector: @selector(
connectionDidUpgradeToTLS:)
withObject: self];
|