我试图禁用一些密码(弱),如单DES,单DES 40位等.
我尝试使用这段代码如何在Cocoa中使用CFSocket/CFStream时设置SSL密码?从邮件列表消息CFNetwork SSL和长阻塞延迟但我需要访问套接字数据来获取CFDataRef.
这是我试图在AFURLConnectionOperation类中的握手方法中插入的代码:
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge (NSURLAuthenticationChallenge *)challenge{
CFReadStreamRef stream = [sock getCFReadStream];
CFDataRef data = CFReadStreamCopyProperty(stream, kCFStreamPropertySocketSSLContext);
// Extract the SSLContextRef from the CFData
SSLContextRef sslContext;
CFDataGetBytes(data, CFRangeMake(0, sizeof(SSLContextRef)), &sslContext);
// Get all enabled ciphers
size_t numCiphers;
SSLGetNumberEnabledCiphers(sslContext,&numCiphers);
SSLCipherSuite ciphers[numCiphers];
SSLGetEnabledCiphers(sslContext,ciphers,&numCiphers);
// Create a new cipher array with only non-DH ciphers, and set it
SSLCipherSuite finalCiphers[numCiphers];
int numFinalCiphers = 0;
for(int i=0; i<numCiphers; i++) {
SSLCipherSuite suite = …Run Code Online (Sandbox Code Playgroud) 我的应用程序启动时出现上述错误.以下代码来自我的AppDelegate .h文件
#import <UIKit/UIKit.h>
@interface TableViewAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UINavigationController *navigationController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@end
Run Code Online (Sandbox Code Playgroud)
以下内容来自我的AppDelegate实现文件.m applicationdidfinishlaunchingwithoptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//Configure and show the window
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
return YES;
}
Run Code Online (Sandbox Code Playgroud)