HTTPS support

Your `getClientHello` function seems more correctly implemented in terms of error handling.