我对iPhone的发展很新。如何使iPhoneHTTPServer安全的服务器
我从bellow链接下载了iPhoneHTTPServer应用程序。 https://github.com/robbiehanson/CocoaHTTPServer/tree/master/Samples/iPhoneHTTPServer
它对HTTP请求正常工作。
现在我想把它作为一个安全的服务器。 (使用HTTPS) 为我所控继MyHTTPConnection.m两种方法
我可以肯定在这个方法的变化:
/**
* Overrides HTTPConnection's method
**/
- (BOOL)isSecureServer
{
// Create an HTTPS server (all connections will be secured via SSL/TLS)
return YES;
}
我需要应用在波纹管方法的变化:(请指引我) 问题:DDKeychain和Cocoa.h不适用于iOS。
/**
* Overrides HTTPConnection's method
*
* This method is expected to returns an array appropriate for use in
* kCFStreamSSLCertificates SSL Settings.
* It should be an array of SecCertificateRefs except for the first element in
* the array, which is a SecIdentityRef.
**/
- (NSArray *)sslIdentityAndCertificates
{
NSArray *result = [DDKeychain SSLIdentityAndCertificates];
if([result count] == 0)
{
[DDKeychain createNewIdentity];
return [DDKeychain SSLIdentityAndCertificates];
}
return result;
}
难道这是重新实现与iOS的相当于是代码DDKeychain功能的情况? https://developer.apple.com/library/mac/#documentation/security/Conceptual/keychainServConcepts/iPhoneTasks/iPhoneTasks.html – Diziet