Skip to content

Commit dc52764

Browse files
ztzgvlaci
authored andcommitted
filetransfer: Add support for cURL SSLCERT/SSLKEY options
1 parent 041d237 commit dc52764

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/libstore/filetransfer.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,12 @@ struct curlFileTransfer : public FileTransfer
410410
if (writtenToSink)
411411
curl_easy_setopt(req, CURLOPT_RESUME_FROM_LARGE, writtenToSink);
412412

413+
if (!request.sslCert.empty())
414+
curl_easy_setopt(req, CURLOPT_SSLCERT, request.sslCert.c_str());
415+
416+
if (!request.sslKey.empty())
417+
curl_easy_setopt(req, CURLOPT_SSLKEY, request.sslKey.c_str());
418+
413419
curl_easy_setopt(req, CURLOPT_ERRORBUFFER, errbuf);
414420
errbuf[0] = 0;
415421

src/libstore/include/nix/store/filetransfer.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ struct FileTransferRequest
6565
std::string uri;
6666
Headers headers;
6767
std::string expectedETag;
68+
Path sslCert;
69+
Path sslKey;
6870
bool verifyTLS = true;
6971
bool head = false;
7072
bool post = false;

0 commit comments

Comments
 (0)