{"thread":{"id":"18669","subject":"[PATCH] Allow any HTTP authentication scheme, not only basic","startedAt":"2009-03-31T17:31:26Z","lastAt":"2009-04-01T15:06:48Z","messageCount":4,"participants":["Martin Storsjo","Johannes Schindelin","Martin Storsjö"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"110045","messageId":"1238520686-546-1-git-send-email-martin@martin.st","threadId":"18669","inReplyTo":null,"subject":"[PATCH] Allow any HTTP authentication scheme, not only basic","fromName":"Martin Storsjo","fromEmail":"martin@martin.st","sentAt":"2009-03-31T17:31:26Z","receivedAt":"2009-03-31T17:31:26Z","isPatch":true,"sender":{"key":"martin@martin.st","avatar":"https://avatars.githubusercontent.com/u/69727?v=4"},"body":"Signed-off-by: Martin Storsjo <martin@martin.st>\n---\n http.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex 2fc55d6..7cb53e8 100644\n--- a/http.c\n+++ b/http.c\n@@ -165,6 +165,7 @@ static CURL *get_curl_handle(void)\n #if LIBCURL_VERSION_NUM >= 0x070907\n \tcurl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);\n #endif\n+\tcurl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n \n \tinit_curl_http_auth(result);\n \n-- \n1.6.0.2\n"},{"id":"110048","messageId":"1238525665-10776-1-git-send-email-martin@martin.st","threadId":"18669","inReplyTo":"1238520686-546-1-git-send-email-martin@martin.st","subject":"[PATCH] Allow any HTTP authentication scheme, not only basic","fromName":"Martin Storsjo","fromEmail":"martin@martin.st","sentAt":"2009-03-31T18:54:25Z","receivedAt":"2009-03-31T18:54:25Z","isPatch":true,"sender":{"key":"martin@martin.st","avatar":"https://avatars.githubusercontent.com/u/69727?v=4"},"body":"Signed-off-by: Martin Storsjo <martin@martin.st>\n---\nUpdated patch, enable only on libcurl versions new enough\n\n http.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex 2fc55d6..eae74aa 100644\n--- a/http.c\n+++ b/http.c\n@@ -165,6 +165,9 @@ static CURL *get_curl_handle(void)\n #if LIBCURL_VERSION_NUM >= 0x070907\n \tcurl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);\n #endif\n+#if LIBCURL_VERSION_NUM >= 0x070a06\n+\tcurl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n+#endif\n \n \tinit_curl_http_auth(result);\n \n-- \n1.6.0.2\n"},{"id":"110050","messageId":"alpine.DEB.1.00.0903312104010.6676@intel-tinevez-2-302","threadId":"18669","inReplyTo":"1238525665-10776-1-git-send-email-martin@martin.st","subject":"Re: [PATCH] Allow any HTTP authentication scheme, not only basic","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-31T19:04:30Z","receivedAt":"2009-03-31T19:04:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 31 Mar 2009, Martin Storsjo wrote:\n\n> Updated patch, enable only on libcurl versions new enough\n\nHeh, you beat me to looking up from which version onward curl supports \nthis...\n\nThanks!\nDscho\n"},{"id":"110143","messageId":"Pine.LNX.4.64.0904011750260.5901@localhost.localdomain","threadId":"18669","inReplyTo":"alpine.DEB.1.00.0903312104010.6676@intel-tinevez-2-302","subject":"Re: [PATCH] Allow any HTTP authentication scheme, not only basic","fromName":"Martin Storsjö","fromEmail":"martin@martin.st","sentAt":"2009-04-01T15:06:48Z","receivedAt":"2009-04-01T15:06:48Z","isPatch":true,"sender":{"key":"martin@martin.st","avatar":"https://avatars.githubusercontent.com/u/69727?v=4"},"body":"Hi,\n\nMy patch doesn't seem to come completely without troubles, though.\n\nI still find this a potentially valuable scenario; e.g. for a public repo \nwith push access only over HTTP, but using secure digest authentication \ninstead of sending the credentials in plaintext.\n\nOne downside is that it causes a lot more HTTP requests, since libcurl \ninitially tries without any authentication for (almost?) every request, \ndoubling the number of requests made.\n\n\nFetching works just fine, but pushing may fail on auth problems in some \ncases where it wouldn't fail otherwise, if only basic authentication was \nused and libcurl automatically used that without probing what \nauthentication scheme the server uses.\n\nThings generally seem to work fine with Apache, but with Lighttpd, \nretrying with proper credentials may fail due to CURLE_SEND_FAIL_REWIND /* \n65 - Sending the data requires a rewind that failed */. This issue can be \nfixed by another patch (that I'll send soon).\n\nEven after fixing that, there still seems to be some issues on some older \ncurl versions; in particular, 7.16.3, shipped in OS X Leopard, returns \nerror code CURLE_HTTP_RETURNED_ERROR instead of retrying properly with \nauthentication.\n\n// Martin\n"}]}