pb593
pb593

Reputation: 91

Setting anonymous cipher on GCDAsyncSocket

Is there any way to enable anonymous ciphers in the GCDAsyncSocket library? So as to connect to a weakly protected server via TLS/SSL.

Upvotes: 1

Views: 286

Answers (1)

pb593
pb593

Reputation: 91

Sorry for the elementary question. Just read the docs again and worked it out. It is like this:

NSMutableDictionary *settings = [[NSMutableDictionary alloc] init];
NSArray* ciphers = [[NSArray alloc] initWithObjects:[NSNumber numberWithUnsignedInt:TLS_DH_anon_WITH_AES_256_CBC_SHA], nil];

[settings setObject:ciphers forKey:GCDAsyncSocketSSLCipherSuites];

[socket startTLS:settings];

Yep, just set an NSArray containing all the necessary cipher suites as a value for key GCDAsyncSocketSSLCipherSuites.

Upvotes: 3

Related Questions