views:

33

answers:

1

hello, I have an app that connects to an inhouse gameserver. I want to wrap the traffic in SSL to prevent hackers from sniffing the passwords and what not. Anyways, how do I go about doing that with an iphone app? I'm using CFNetwork to communicate to the server, and everything is in our own inhouse protocol instead of using http or something like that.

Thanks

+1  A: 

You will need to set the appropriate CFStream properties prior to opening the streams. You do so by first preparing a dictionary using the appropriate kCFStreamSSL* keys and corresponding values and then calling CFWriteStreamSetProperty() to set that dictionary as the kCFStreamPropertySSLSettings property. The property should be shared between both streams in the connection pair.

If your server attempts to negotiate an SSL connection, I believe the streams will cooperate in the negotiation by default. You might have less work to do than you think.

Jeremy W. Sherman