sssd/0089-secrets-support-HTTP-basic-authentication-with-proxy.patch
Lukas Slebodnik 387014f928 Backport upstream patches for 1.15.3 pre-release
required for building freeipa-4.5.x in rawhide
2017-04-04 16:22:51 +02:00

39 lines
1.3 KiB
Diff

From af026ea6a6e812b7d6c5c889dda64ba7b7c433ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Tue, 28 Feb 2017 13:58:20 +0100
Subject: [PATCH 89/97] secrets: support HTTP basic authentication with proxy
provider
Even though configuration options auth_type = basic, username and password
are read they were not used anywhere prior this patch.
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
---
src/responder/secrets/proxy.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/responder/secrets/proxy.c b/src/responder/secrets/proxy.c
index 240a1de1e431d511a1eca24d8b463c37ba893e7b..fd96e985c897e2cb470a9b5d6eecbd34350fb7d2 100644
--- a/src/responder/secrets/proxy.c
+++ b/src/responder/secrets/proxy.c
@@ -440,6 +440,15 @@ static errno_t proxy_http_create_request(TALLOC_CTX *mem_ctx,
}
}
+ /* Set basic authentication if required. */
+ if (pcfg->auth_type == PAT_BASIC_AUTH) {
+ ret = tcurl_req_http_basic_auth(tcurl_req, pcfg->auth.basic.username,
+ pcfg->auth.basic.password);
+ if (ret != EOK) {
+ goto done;
+ }
+ }
+
talloc_steal(tcurl_req, body);
*_tcurl_req = talloc_steal(mem_ctx, tcurl_req);
--
2.12.2