owncloud/ios-library — pull request #57 by eliburke (2014-09-23 17:16:09+00:00)
Title: Added AFSecurityPolicy property to OCCommunication.

I know the issue of self-signed certificates was discussed in #51 and #52, but I just spend the last day banging my head against the same problem and re-creating the same solution. (silly me; I should have looked at the closed issues sooner). This patch will allow global override of the AFSecurityPolicy, primarily to enable checking of self-signed certificates. If you have .cer files, you can use a stock AFSecurityPolicy, otherwise you can override evaluateServerTrust:(SecTrustRef)serverTrust forDomain:(NSString *)domain and do your own checking.

The patch adds a new AFSecurityPolicy property on OCCommunication. It is initialized to the default security policy, but can be overwritten after the OCCommunication object is initialized. The stored policy object is then copied into the uploadSessionManager and OCWebDavClient and OCHttpRequestOperation objects on demand.