diff --git a/libfetch/http.c b/libfetch/http.c
index 08b23615a7777d4b9515f5a18bcfdafdafe91ec6..418968af2c28b349d98b0b2246ef4bf4552b75e9 100644
--- a/libfetch/http.c
+++ b/libfetch/http.c
@@ -711,11 +711,8 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached)
 		/* fetch_connect() has already set an error code */
 		return (NULL);
 	if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) {
-		http_cmd(conn, "CONNECT %s:%d HTTP/1.1\r\n",
-				URL->host, URL->port);
-		http_cmd(conn, "Host: %s:%d\r\n",
-				URL->host, URL->port);
-		http_cmd(conn, "\r\n");
+		http_cmd(conn, "CONNECT %s:%d HTTP/1.1\r\nHost: %s:%d\r\n\r\n",
+			 URL->host, URL->port, URL->host, URL->port);
 		if (http_get_reply(conn) != HTTP_OK) {
 			http_seterr(conn->err);
 			goto ouch;