我對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