From 31301b46a726e8c95836e885bb8a7f5cc5221c49 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Tue, 28 Aug 2018 10:37:34 -0600 Subject: file: Allow DOWNLOAD/UPLOAD using alternate authentication methods --- Source/cmFileCommand.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 0c80319..d49e490 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2886,6 +2886,10 @@ bool cmFileCommand::HandleDownloadCommand(std::vector const& args) ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); check_curl_result(res, "DOWNLOAD cannot set url: "); + // enable auth + res = ::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + check_curl_result(res, "DOWNLOAD cannot set httpauth: "); + // enable HTTP ERROR parsing res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); check_curl_result(res, "DOWNLOAD cannot set http failure option: "); @@ -3185,6 +3189,10 @@ bool cmFileCommand::HandleUploadCommand(std::vector const& args) res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); check_curl_result(res, "UPLOAD cannot set url: "); + // enable auth + res = ::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + check_curl_result(res, "UPLOAD cannot set httpauth: "); + res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToMemoryCallback); check_curl_result(res, "UPLOAD cannot set write function: "); -- cgit v0.12