I have no clue how to make an FTPS (FTP over SSL) on the iPhone. I would like to use the following code
ftpStream = CFWriteStreamCreateWithFTPURL(NULL, (CFURLRef) url);
CFWriteStreamSetProperty(ftpStream, kCFStreamPropertyFTPUserName,username);
CFWriteStreamSetProperty(ftpStream, kCFStreamPropertyFTPPassword,password);
self.networkStream = (NSOutputStream *) ftpStream;
[self.networkStream setProperty:NSStreamSocketSecurityLevelSSLv3 forKey:(id)NSStreamSocketSecurityLevelKey];
self.networkStream.delegate = self;
[self.networkStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[self.networkStream open];
...
- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode
{
NSLog(@"Hello\n");
}
This code connects to the server but then stops talking all together. I have also tried using the following to set the security level
NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
(NSString *)kCFStreamSocketSecurityLevelSSLv3, kCFStreamSSLLevel,
kCFBooleanTrue, kCFStreamSSLAllowsAnyRoot,
kCFBooleanFalse, kCFStreamSSLValidatesCertificateChain,
hostName, kCFStreamSSLPeerName,
kCFBooleanFalse, kCFStreamSSLIsServer,
kCFBooleanFalse,kCFStreamSSLValidatesCertificateChain,
kCFBooleanTrue, kCFStreamSSLAllowsExpiredCertificates,
kCFBooleanTrue, kCFStreamSSLAllowsExpiredRoots,
nil];
CFWriteStreamSetProperty(ftpStream, kCFStreamPropertySSLSettings, settings);
This allows me to connect and transfer data but not through SSL.
Any idea what I am doing wrong.