From 5204e1dd9d3943bf7bc54a39ccbc1ceab8d1aecb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 May 2018 14:12:18 -0400 Subject: [PATCH] Workaround for bug in an old version of cryptonite that broke https downloads, by using curl for downloads when git-annex is built with it. This commit was supported by the NSF-funded DataLad project. --- CHANGELOG | 2 ++ Utility/Url.hs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index ba0ee2163e..26cf448afb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ git-annex (6.20180510) UNRELEASED; urgency=medium * view, vadd: Fix crash when a git submodule has a name starting with a dot. * Don't allow entering a view with staged or unstaged changes. + * Workaround for bug in an old version of cryptonite that broke https + downloads, by using curl for downloads when git-annex is built with it. -- Joey Hess Mon, 14 May 2018 13:42:41 -0400 diff --git a/Utility/Url.hs b/Utility/Url.hs index 84f5cb005c..1a47af7770 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -90,7 +90,13 @@ mkUrlOptions defuseragent reqheaders reqparams manager = UrlOptions useragent reqheaders urldownloader applyrequest manager where urldownloader = if null reqparams +#if MIN_VERSION_cryptonite(0,6) then DownloadWithConduit +#else + -- Work around for old cryptonite bug that broke tls. + -- https://github.com/vincenthz/hs-tls/issues/109 + then DownloadWithCurl reqparams +#endif else DownloadWithCurl reqparams applyrequest = \r -> r { requestHeaders = requestHeaders r ++ addedheaders } addedheaders = uaheader ++ otherheaders