{"thread":{"id":"40203","subject":"http.c (curl_easy_setopt and CURLAUTH_ANY)","startedAt":"2015-08-28T06:07:36Z","lastAt":"2015-08-29T00:33:18Z","messageCount":4,"participants":["Stephen Kazakoff","Daniel Stenberg","Johannes Schindelin","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"268823","messageId":"CAF0pADEsO0y_6wcx-xNwRqjauJmMcQ8mUmbUbbWCBrK2gQ1quA@mail.gmail.com","threadId":"40203","inReplyTo":null,"subject":"http.c (curl_easy_setopt and CURLAUTH_ANY)","fromName":"Stephen Kazakoff","fromEmail":"sh.kazakoff@gmail.com","sentAt":"2015-08-28T06:07:36Z","receivedAt":"2015-08-28T06:07:36Z","isPatch":false,"sender":{"key":"sh.kazakoff@gmail.com","avatar":null},"body":"Hi,\n\nWhen I'm behind a proxy (with BASIC authentication), I'm unable to\nperform a git clone.\n\nI managed to fix this by editing http.c and recompiling. The change\nI'd like to propose is to line 452.\n\n\nFrom:\n\ncurl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n\nTo:\n\ncurl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);\n\n\nI did however find the CURL documentation\n(https://secure.php.net/manual/en/function.curl-setopt.php) slightly\nconflicting. On one hand, \"CURLAUTH_ANY\" is effectively the same as\npassing \"CURLAUTH_BASIC | CURLAUTH_NTLM\". But the documentation for\n\"CURLOPT_PROXYAUTH\" says that only \"CURLAUTH_BASIC\" and\n\"CURLAUTH_NTLM\" are currently supported. By that, I'm assuming\n\"CURLAUTH_ANY\" is not supported.\n\nAlso, I do not have access to a NTLM proxy, so I cannot test that\nbehaviour. Would someone be able to confirm or deny this bug?\n\n\nKind regards,\nSteve\n"},{"id":"268825","messageId":"alpine.DEB.2.11.1508280831230.20243@tvnag.unkk.fr","threadId":"40203","inReplyTo":"CAF0pADEsO0y_6wcx-xNwRqjauJmMcQ8mUmbUbbWCBrK2gQ1quA@mail.gmail.com","subject":"Re: http.c (curl_easy_setopt and CURLAUTH_ANY)","fromName":"Daniel Stenberg","fromEmail":"daniel@haxx.se","sentAt":"2015-08-28T06:34:04Z","receivedAt":"2015-08-28T06:34:04Z","isPatch":false,"sender":{"key":"daniel@haxx.se","avatar":"https://gravatar.com/avatar/69fdca87edd17cee21ca2e79fc2ff671d644603c3dc27167430f3cd3dbab7ba8?d=mp&s=160"},"body":"On Fri, 28 Aug 2015, Stephen Kazakoff wrote:\n\n> From:\n> curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n>\n> To:\n> curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);\n>\n> I did however find the CURL documentation \n> (https://secure.php.net/manual/en/function.curl-setopt.php) slightly \n> conflicting. On one hand, \"CURLAUTH_ANY\" is effectively the same as passing \n> \"CURLAUTH_BASIC | CURLAUTH_NTLM\". But the documentation for \n> \"CURLOPT_PROXYAUTH\" says that only \"CURLAUTH_BASIC\" and \"CURLAUTH_NTLM\" are \n> currently supported. By that, I'm assuming \"CURLAUTH_ANY\" is not supported.\n\nThat would rather indicate a problem somewhere else.\n\nCURLAUTH_ANY is just a convenience define that sets a bunch of bits at once, \nand libcurl will discard bits you'd set for auth methods your libcurl hasn't \nbeen built to deal with anyway. Thus, the above two lines should result in \n(almost) exactly the same behavior from libcurl's point of view.\n\nThe fact that they actually make a difference is probably because ANY then \nenables a third authentication method that perhaps your server doesn't like? \nOr is it a libcurl bug?\n\nHard to tell without more info, including libcurl version. But no, the above \nsuggested change doesn't really make much sense for the general population.\n\n-- \n\n  / daniel.haxx.se\n"},{"id":"268827","messageId":"e2b492394d92d8aecf45a53ee6af1875@www.dscho.org","threadId":"40203","inReplyTo":"CAF0pADEsO0y_6wcx-xNwRqjauJmMcQ8mUmbUbbWCBrK2gQ1quA@mail.gmail.com","subject":"Re: http.c (curl_easy_setopt and CURLAUTH_ANY)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-08-28T09:23:15Z","receivedAt":"2015-08-28T09:23:15Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Stephen,\n\nOn 2015-08-28 08:07, Stephen Kazakoff wrote:\n\n> When I'm behind a proxy (with BASIC authentication), I'm unable to\n> perform a git clone.\n> \n> I managed to fix this by editing http.c and recompiling. The change\n> I'd like to propose is to line 452.\n> \n> \n> From:\n> \n> curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n> \n> To:\n> \n> curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);\n\nBut `CURLAUTH_ANY` should imply `_BASIC` and `_NTLM`. I remember that the `_ANY` was supposed to avoid hard-coding things.\n\nAccording to\n\n    https://github.com/bagder/curl/blob/ac7be02e695af95e93b3f5a40b80dcab782f5321/include/curl/curl.h#L651\n\nit should actually imply even more. Maybe that is the problem? Could you debug further by setting the environment variable GIT_CURL_VERBOSE=1?\n\nCiao,\nJohannes\n"},{"id":"268879","messageId":"20150829003318.GA469190@vauxhall.crustytoothpaste.net","threadId":"40203","inReplyTo":"CAF0pADEsO0y_6wcx-xNwRqjauJmMcQ8mUmbUbbWCBrK2gQ1quA@mail.gmail.com","subject":"Re: http.c (curl_easy_setopt and CURLAUTH_ANY)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2015-08-29T00:33:18Z","receivedAt":"2015-08-29T00:33:18Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Fri, Aug 28, 2015 at 04:07:36PM +1000, Stephen Kazakoff wrote:\n> Hi,\n> \n> When I'm behind a proxy (with BASIC authentication), I'm unable to\n> perform a git clone.\n> \n> I managed to fix this by editing http.c and recompiling. The change\n> I'd like to propose is to line 452.\n> \n> \n> From:\n> \n> curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n> \n> To:\n> \n> curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);\n\nAssuming it's supported upstream, I suspect this would break people who\nare using GSSAPI (or Digest) authentication for their proxy.  This would\nbe a logical thing to do where Kerberos is used.\n\nIt might be worth checking exactly which bits cause problems for you;\nperhaps your proxy might be misconfigured to suggest a type that it\ndoesn't support.\n\n> I did however find the CURL documentation\n> (https://secure.php.net/manual/en/function.curl-setopt.php) slightly\n> conflicting. On one hand, \"CURLAUTH_ANY\" is effectively the same as\n> passing \"CURLAUTH_BASIC | CURLAUTH_NTLM\". But the documentation for\n> \"CURLOPT_PROXYAUTH\" says that only \"CURLAUTH_BASIC\" and\n> \"CURLAUTH_NTLM\" are currently supported. By that, I'm assuming\n> \"CURLAUTH_ANY\" is not supported.\n\nThis looks like the documentation for PHP.  The libcurl documentation[0]\ndoesn't mention a limitation.\n\n[0] http://curl.haxx.se/libcurl/c/CURLOPT_PROXYAUTH.html\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"}]}