This isn’t a library I’m too familiar with and as it is based on Apache HttpClient my first suggestion would be to switch to something like Retrofit.

That being said, if you must implement pinning with AsyncHttpClient then it looks as though the easiest approach is to provide your own `SSLSocketFactory` through `client.setSSLSocketFactory(…)` and apply a similar approach as seen in Pinning with Apache HttpClient.

By default the library generates the SSLSocketFactory using `SSLSocketFactory.getSocketFactory(),` so assuming you support IceCreamSandwich and up, simply generate the factory using that and wrap the `HostnameVerifier` with one that pins.

When creating your own `SSLSocketFactory` it is easy to weaken your security with an incorrect implementation so using the default as the basis is often a safer bet than creating your own ‘custom’ implementation.

Matt Dolan has been eating doughnuts and developing with Android since the dark days of v1.6.