Ah, right. When I debugged, it didn't use the socketFactory else branch, but I guess that was a fault in my settings.
Didn't know that the socketFactory is used for proxies, I thought a user can explicitly set one for some other purposes.
Thanks, I've definitively didn't look deep enough.