Index: libsoup/soup-message-client-io.c
===================================================================
--- libsoup/soup-message-client-io.c	(revision 1142)
+++ libsoup/soup-message-client-io.c	(working copy)
@@ -57,6 +57,11 @@
 {
 	GString *headers = data;
 
+	/* 'Host' is a header we always add, so there no need to
+ 	add the (user specified) 'Host' header again */
+	if (!name || strcmp((char*)name, "Host") == 0)
+		return;
+
 	g_string_append_printf (headers, "%s: %s\r\n",
 				(char *)name, (char *)value);
 }
@@ -71,6 +76,7 @@
 	const SoupUri *uri = soup_message_get_uri (req);
 	const char *expect;
 	char *uri_string;
+	const char *host;
 
 	if (!strcmp (req->method, "CONNECT")) {
 		/* CONNECT URI is hostname:port for tunnel destination */
@@ -88,12 +94,14 @@
 	} else {
 		g_string_append_printf (header, "%s %s HTTP/1.1\r\n",
 					req->method, uri_string);
+		host = soup_message_get_header (req->request_headers, "Host");
+		if (!host)
+			host = uri->host;
 		if (soup_uri_uses_default_port (uri)) {
-			g_string_append_printf (header, "Host: %s\r\n",
-						uri->host);
+			g_string_append_printf (header, "Host: %s\r\n", host);
 		} else {
 			g_string_append_printf (header, "Host: %s:%d\r\n",
-						uri->host, uri->port);
+						host, uri->port);
 		}
 	}
 	g_free (uri_string);
