Skip to content

Commit

Permalink
Add support for overriding the CA directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbockelm committed Dec 29, 2017
1 parent 9563b8b commit 9e1b31e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/tpc.cpp
Expand Up @@ -543,7 +543,9 @@ class XrdHttpTPC : public XrdHttpExtHandler {
fh->close();
return resp_result;
}

if (!m_cadir.empty()) {
curl_easy_setopt(curl, CURLOPT_CAPATH, m_cadir.c_str());
}
curl_easy_setopt(curl, CURLOPT_URL, resource.c_str());

XrdHttpTPCState state(std::move(fh), curl, true);
Expand Down Expand Up @@ -590,6 +592,9 @@ class XrdHttpTPC : public XrdHttpExtHandler {
fh->close();
return resp_result;
}
if (!m_cadir.empty()) {
curl_easy_setopt(curl, CURLOPT_CAPATH, m_cadir.c_str());
}
curl_easy_setopt(curl, CURLOPT_URL, resource.c_str());
XrdHttpTPCState state(std::move(fh), curl, false);
state.CopyHeaders(req);
Expand Down Expand Up @@ -684,6 +689,13 @@ class XrdHttpTPC : public XrdHttpExtHandler {
m_log.Emsg("Config", "https.dests value is invalid", val);
return false;
}
} else if (!strcmp("http.cadir", val)) {
if (!(val = Config.GetWord())) {
Config.Close();
m_log.Emsg("Config", "http.cadir value not specified");
return false;
}
m_cadir = val;
}
}
Config.Close();
Expand Down Expand Up @@ -733,6 +745,7 @@ class XrdHttpTPC : public XrdHttpExtHandler {

static constexpr int m_marker_period = 5;
bool m_desthttps{false};
std::string m_cadir;
static std::atomic<uint64_t> m_monid;
XrdSysError &m_log;
std::unique_ptr<XrdSfsFileSystem> m_sfs;
Expand Down

0 comments on commit 9e1b31e

Please sign in to comment.