fixed socket timeout and SSL socket creation.