Fix support for non-https custom api hosts