diff --git a/libsoup/soup-auth-manager.c b/libsoup/soup-auth-manager.c
index 62fe9c40..bc3788eb 100644
--- a/libsoup/soup-auth-manager.c
+++ b/libsoup/soup-auth-manager.c
@@ -479,6 +479,9 @@ lookup_auth (SoupAuthManagerPrivate *priv, SoupMessage *msg)
 	if (!host->auth_realms && !make_auto_ntlm_auth (priv, host))
 		return NULL;
 
+	if (!host->auth_realms)
+		return NULL;
+
 	path = soup_message_get_uri (msg)->path;
 	if (!path)
 		path = "/";
