set up socket timeout before doing ssl handshake for HTTPS connection

Bug: 963042
Change-Id: Id10f3c80caa4f8105cb1b959bc6c4489fd636bf3