HTTPS support

After testing a few options uri.scheme seemed to be the most reliable way to detect https, so I switched off that.