summaryrefslogtreecommitdiff
path: root/methods/https.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/https.cc')
-rw-r--r--methods/https.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/methods/https.cc b/methods/https.cc
index dbc1cf52c..86d7f3a6b 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -14,6 +14,7 @@
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/netrc.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -126,8 +127,10 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_reset(curl);
SetupProxy();
+ maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
+
// callbacks
- curl_easy_setopt(curl, CURLOPT_URL, Itm->Uri.c_str());
+ curl_easy_setopt(curl, CURLOPT_URL, static_cast<string>(Uri).c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);