Add support for HTTPS connections.

I chose to make HTTPS implicit on specifying port 443. It would also be possible to add a separate "https" flag that would imply port 443.