robbiehanson/CocoaAsyncSocket — pull request #241 by Thamster (2014-05-30 01:01:11+00:00)
Title: extended AsyncSocket to allow for client side cert based auth, using pri...

extended AsyncSocket to allow for client side cert based auth, using private _kCFStreamPropertySSLClientSideAuthentication and kCFStreamPropertySocketSSLContext CFStream constants, kCFStreamPropertySSLClientSideAuthentication was currently silently ignored by apple CF Security methods as it can only be set on the ssl context after initialization.

This change was only done for the RunLoop non GCD non Arc version (7.0.X branch) as I had to work on a project that required very far back backwards compatibility.

You might be interested in this, though it is only a fix for the now deprecated 7.0.X branch, it isn't a large change but it takes a long time to figure out what is wrong with client side cert based auth, you get no error messages as is and the client cert comes back as nil on the server side.

This way all the user has to now do is add the following to the server tls settings before calling startTLS and the ssl handshaking will provide the client cert back to the server on the "didSecure" callback, instead of nil and no error messages:

extern const CFStringRef _kCFStreamPropertySSLClientSideAuthentication; // in CFNetwork
...
@{
...
(id)_kCFStreamPropertySSLClientSideAuthentication : @(kAlwaysAuthenticate), // not usable in app store, not required on client side
...
}

Thanks a lot for your work on AsyncSocket, by the way. Really came in handy for a project I'm working on.
Regards,