All this Http and SSL stuff looks like a good candidate to be encapsulated into some form of HttpUrlConnectionFactory that can be shared.