add support for custom SSLSocketFactory

Can be used for pinning, self-signed certificates, etc.