Support HTTPS repositories.

See commits for comments.