Fix long broken HTTP/HTTPS support from upstream.