owncloud/ios-library — pull request #63 by eliburke (2014-10-06 21:04:14+00:00)
Title: Added AFSecurityPolicy property to OCCommunication (new pull request for branch)

@javiergonzper I hope I did this right, per your request in #57 to use a branch. I use github just enough to be dangerous. :-)

The basic idea is simple. Create your OCCommunication object however you like, and then optionally set a new AFSecurityPolicy. It will automatically update the upload and download sessions manager objects, if they exist (I went back and forth on this one... i think it's the correct behavior for 99% of cases)

The example code in OCCommunicationLibTests.m shows such a scenario.. after creating OCCommunication, it creates a policy that disables certificate checks. I did not test this, but it's EXTREMELY straightforward so hopefully bug free.

Perhaps if I get some time I will push some sample code that shows loading certificates from a PEM file and checking them in a AFSecurityPolicy object that overrides - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust forDomain:(NSString *)domain;