iPhone 应用程序的 SSL 包装器
我有一个连接到内部游戏服务器的应用程序。我想将流量封装在 SSL 中,以防止黑客嗅探密码等。无论如何,我该如何使用 iPhone 应用程序来做到这一点?我使用 CFNetwork 与服务器通信,一切都在我们自己的内部协议中,而不是使用 http 或类似的协议。
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要设置适当的 CFStream 属性< /a> 在打开流之前。为此,您首先使用适当的
kCFStreamSSL*
键和相应的值准备一个字典,然后调用CFWriteStreamSetProperty()
将该字典设置为kCFStreamPropertySSLSettings
> 财产。该属性应在连接对中的两个流之间共享。如果您的服务器尝试协商 SSL 连接,我相信默认情况下流将在协商中进行合作。你要做的工作可能比你想象的要少。
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 callingCFWriteStreamSetProperty()
to set that dictionary as thekCFStreamPropertySSLSettings
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.