iPhoneHTTPServer with SSL and certificate

261 views
Skip to first unread message

Dev

unread,
Aug 21, 2014, 5:11:00 AM8/21/14
to cocoaht...@googlegroups.com
Hi everyone,
I'm using the iPhoneHTTPServer sample into my project for using HTTPServer, and host a .plist file with a .ipa to simulate an ad-hoc deployment.
As you know (or maybe not ^^), since iOS7, the server which hosts files must be secured, and so I'm trying to use a SSL authentification, but it failed.
First, the server seems to start correctly, but it failed when I'm trying to access to my server like this :

NSURL *plistUrl = [NSURL URLWithString:@"itms-services://?action=download-manifest&url=https://localhost:8080/TestMAJ2.plist"];
[[UIApplication sharedApplication] openURL:plistUrl];

I have this error :

NSAssert(NO, @"Security option unavailable - kCFStreamSSLLevel" @" - You must use GCDAsyncSocketSSLProtocolVersionMin & GCDAsyncSocketSSLProtocolVersionMax");

How can I bypass this error ? I was trying to removed the kCFStreamSSLLevel of the TLS settings (why not ? ^^), but the connection still don't work, I've got a popup with "Unable to connect to localhost" or something like that ...

About the SSL authentification, the DDKeychain class from the sample was not good because it's Mac's API, so I use this code : http://stackoverflow.com/questions/11258911/how-to-make-iphonehttpserver-secure-server, and the certificate come from Keychain Access, and it's the certificate that I used for signing my app. Maybe it's not the correct certificate ? Or the correct piece of code ? Do you know a very simple example of using SecureHTTPServer in iOS ?

Many thanks.





Dev

unread,
Sep 3, 2014, 4:14:56 AM9/3/14
to cocoaht...@googlegroups.com
Nobody for my problem ?

Sureshbabu Rajendiran

unread,
Sep 7, 2016, 1:11:01 AM9/7/16
to CocoaHTTPServer
Hi,

Did you got it working. I am facing the same issue.
Reply all
Reply to author
Forward
0 new messages