HTTPS support

@log.debug maybe?