Basic support for HTTPS.
Fixes setting protocol_version in unit test handler. Adds more debug logs.