Pinning certificates will now trust all derived certificates.
AFHTTPClient now applies its default pinning mode to all enqueued ope…
…rations if their SSLPinningMode has not been set explicitly.
I wonder if 05a991b is a little to much since the pinning mode is already being set in HTTPOperationWithRequest:success:failure:? Do you think it will be a common use case to need to change the pinning mode on the fly with operations already queued up? I feel like the 99% use case would be a setup step when creating the AFHTTPClient, and you can assume that whenever the operation is created, it gets the current pinning mode set on the client. If you for some reason you need that to change, you would need to cancel your operations and recreate them with the new pinning mode set.
Ouch. I wasn't aware that for example -[AFHTTPClient HTTPRequestOperationWithRequest:success:failure:] already returns a JSON object for AFJSONRequestOperation. But I still think it makes sense because if you create an AFHTTPRequestOperation and enqueue it manually to an AFHTTPClient instance, the operation should inherit the default pinning mode.
If you create an operation that way, you also miss out on everything else that is set by default for the client (i.e. auth, request headers, parameter encoding, etc). I would expect this property to behave exactly the same as the others.
Maybe auth, request headers, parameter encoding, etc should inherit these values as well?
I would imagine that @mattt would prefer to keep the library as light weight as possible, and the swizzling here is overkill.
If you create your own operation outside of the built in client methods, it should be on the developer to configure that operation to their hearts content :)
light weight is a good point but setting the default values on enqueuing operations still feels kind of right to me. :S
I mean you could still use your custom NSOperationQueue not managed by AFHTTPClient or directly calling [httpClient.operationQueue addOperation:...]. In these two cases I would expect no default values being applied to the operation, but for -[AFHTTPClient enqueueHTTPRequestOperation:], I would.
Perhaps it makes sense to split this into two separate pull requests? a91f40b is useful on its own, and it sounds like 05a991b is inviting more general discussion.