diff --git a/tests/auth-test.c b/tests/auth-test.c
index 992e3d5..6542d30 100644
--- a/tests/auth-test.c
+++ b/tests/auth-test.c
@@ -1085,7 +1085,8 @@ static void
 infinite_authenticate (SoupSession *session, SoupMessage *msg,
 		       SoupAuth *auth, gboolean retrying, gpointer data)
 {
-	soup_auth_authenticate (auth, "user", "bad");
+	if (!retrying)
+		soup_auth_authenticate (auth, "user", "bad");
 }
 
 static void
@@ -1199,6 +1200,51 @@ do_disappearing_auth_test (void)
 	soup_test_server_quit_unref (server);
 }
 
+static void
+utf8_password_authenticate (SoupSession *session, SoupMessage *msg,
+			    SoupAuth *auth, gboolean retrying, gpointer data)
+{
+	soup_auth_authenticate (auth, "user4", "realm§");
+}
+
+static void
+do_utf8_password_basic_auth_test (const gchar *base_uri_str)
+{
+	SoupSession *session;
+	SoupMessage *msg;
+	SoupURI *base_uri, *soup_uri;
+	char *uristr;
+
+	debug_printf (1, "\nTesting auth with non-ASCII password:\n");
+
+	session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, NULL);
+	g_signal_connect (session, "authenticate",
+			  G_CALLBACK (utf8_password_authenticate), NULL);
+
+	base_uri = soup_uri_new (base_uri_str);
+	soup_uri = soup_uri_new_with_base (base_uri, "Basic/realm4");
+	msg = soup_message_new_from_uri (SOUP_METHOD_GET, soup_uri);
+	soup_uri_free (soup_uri);
+	if (!msg) {
+		g_printerr ("auth-test: Could not parse URI\n");
+		exit (1);
+	}
+
+	uristr = soup_uri_to_string (soup_message_get_uri (msg), FALSE);
+	debug_printf (1, "  GET %s\n", uristr);
+	g_free (uristr);
+
+	soup_session_send_message (session, msg);
+	if (msg->status_code != SOUP_STATUS_OK) {
+		debug_printf (1, "  %d %s !\n", msg->status_code,
+			      msg->reason_phrase);
+		errors++;
+	}
+
+	soup_uri_free (base_uri);
+	soup_test_session_abort_unref (session);
+}
+
 static SoupAuthTest relogin_tests[] = {
 	{ "Auth provided via URL, should succeed",
 	  "Basic/realm12/", "1", TRUE, "01", SOUP_STATUS_OK },
@@ -1326,6 +1372,7 @@ main (int argc, char **argv)
 	do_auth_close_test ();
 	do_infinite_auth_test (base_uri);
 	do_disappearing_auth_test ();
+	do_utf8_password_basic_auth_test (base_uri);
 
 	test_cleanup ();
 	return errors != 0;
diff --git a/tests/htpasswd b/tests/htpasswd
index 04e9ce2..30eb351 100644
--- a/tests/htpasswd
+++ b/tests/htpasswd
@@ -1,3 +1,4 @@
 user1:sTFk2g6n8RsWY
 user2:N.Dlbd.xU4K1w
 user3:c2vSU/3eQHy.w
+user4:wytkKpfPTlB0A
diff --git a/tests/httpd.conf.22.in b/tests/httpd.conf.22.in
index de0b75f..36070f7 100644
--- a/tests/httpd.conf.22.in
+++ b/tests/httpd.conf.22.in
@@ -171,6 +171,7 @@ Alias /Basic/realm12/subdir @srcdir@
 Alias /Basic/realm12 @srcdir@
 Alias /Basic/realm2 @srcdir@
 Alias /Basic/realm3 @srcdir@
+Alias /Basic/realm4 @srcdir@
 Alias /Basic @srcdir@
 
 <Location /Basic/realm1>
@@ -222,6 +223,13 @@ Alias /Basic @srcdir@
   Require user user3
 </Location>
 
+<Location /Basic/realm4>
+  AuthType Basic
+  AuthName realm4
+  AuthUserFile @srcdir@/htpasswd
+  Require user user4
+</Location>
+
 # Digest auth tests
 Alias /Digest/realm1/realm2/realm1 @srcdir@
 Alias /Digest/realm1/realm2 @srcdir@
diff --git a/tests/httpd.conf.24.in b/tests/httpd.conf.24.in
index 2407ad7..d473a13 100644
--- a/tests/httpd.conf.24.in
+++ b/tests/httpd.conf.24.in
@@ -156,6 +156,7 @@ Alias /Basic/realm12/subdir @srcdir@
 Alias /Basic/realm12 @srcdir@
 Alias /Basic/realm2 @srcdir@
 Alias /Basic/realm3 @srcdir@
+Alias /Basic/realm4 @srcdir@
 Alias /Basic @srcdir@
 
 <Location /Basic/realm1>
@@ -207,6 +208,13 @@ Alias /Basic @srcdir@
   Require user user3
 </Location>
 
+<Location /Basic/realm4>
+  AuthType Basic
+  AuthName realm4
+  AuthUserFile @srcdir@/htpasswd
+  Require user user4
+</Location>
+
 # Digest auth tests
 Alias /Digest/realm1/realm2/realm1 @srcdir@
 Alias /Digest/realm1/realm2 @srcdir@
