CFNetwork 是否有任何方法可以启用匿名密码——也就是说,我们可以使用 SSL 连接代码连接到某些(保护较弱的)服务器?
最佳答案
Is there any way with CFNetwork to enable anonymous ciphers
是的。设置密码套件非常简单:
SSLContextRef ctx = NULL;
SSLNewContext(NO /*client*/, &ctx);
SSLCipherSuite cipher = TLS_DH_anon_WITH_AES_256_CBC_SHA;
SSLSetEnabledCiphers(ctx, &cipher, 1);
...
将它连接到更高级别的对象,如 NSURLConnection
,是很困难的。参见 Configure socket used by NSURLConnection?在 Apple Networking 邮件列表上。
另见 Using SSLSetEnabledCiphers with AFNetworking to disable weak ciphers .
以下是关于该问题的雷达:
- iOS、Apple RADAR 17904439,“无法在 NSURLConnection 和 friend 上设置 SSLContext”
- OS X,Apple RADAR 17904536,“无法在 NSURLConnection 和 friend 上设置 SSLContext”
- iOS,OpenRadar 5843780150231040,"Unable to set SSLContext on NSURLConnection and friends"
- OS X,OpenRadar 5810038887153664,"Unable to set SSLContext on NSURLConnection and friends"
关于ios - CFNetwork 匿名密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25121744/