Improve ssl socket connect. Use firedns as hostname resolver. Error handling