git 2.8(2016 年 3 月)应该可以缓解这个问题强制输入空用户名和密码http认证期间:
See commit 121061f https://github.com/git/git/commit/121061f67fd47aed5b2f3a7deb82af15215636bd (15 Feb 2016) by brian m. carlson (bk2204) https://github.com/bk2204.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 65ba75b https://github.com/git/git/commit/65ba75ba7daae3298139f18cf866a23d01f4dd48, 24 Feb 2016)
http
:添加选项以尝试无需用户名进行身份验证
使用 Kerberos 执行 GSS-Negotiate 身份验证不需要指定用户名或密码,因为该信息已经存在
包含在门票本身中。
然而,libcurl
如果未提供用户名和密码,则拒绝执行身份验证。
添加一个选项,http.emptyAuth
,这提供了libcurl
使用空的用户名和密码以使其尝试进行身份验证。
The git config文档 https://github.com/git/git/blob/121061f67fd47aed5b2f3a7deb82af15215636bd/Documentation/config.txt#L1603-L1607会提到:
http.emptyAuth:
尝试进行身份验证而不需要用户名或密码。
这可用于尝试 GSS-Negotiate 身份验证,而无需在 URL 中指定用户名,如下所示libcurl
通常需要用户名进行身份验证。
Git 2.10.2(2016 年 10 月)将改进这一点。
See commit 5275c30 https://github.com/git/git/commit/5275c3081c2b2c6166a2fc6b253a3acb20f8ae89 (04 Oct 2016) by David Turner (csusbdt) https://github.com/csusbdt.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit c6400bf https://github.com/git/git/commit/c6400bf8d5437e7614c86e6b027761e11ed7a1be, 17 Oct 2016)
http: http.emptyauth
应该允许空(不仅仅是 NULL)用户名
当将 Kerberos 身份验证与较新版本的 libcurl 结合使用时,CURLOPT_USERPWD
必须设置为一个值,即使它是空值。
该值永远不会发送到服务器。
以前版本的 libcurl 不需要设置此变量。
一些用户表达空用户名/密码的一种方法是http://:@gitserver.example.com
, which http.emptyauth
旨在支持。
另一个等效的 URL 是http://@gitserver.example.com
.
后者导致用户名长度为零,而不是NULL
用户名,但是CURLOPT_USERPWD
仍然需要设置(如果http.emptyauth
已设置)。
这样做。
当服务器仅支持单一身份验证方法时,Git 2.13(2017 年第二季度)将减少通过 HTTP 的身份验证往返。
See commit 40a18fc https://github.com/git/git/commit/40a18fc77ca3ba1b018f0fbdcbdf4a6d237aadf3 (25 Feb 2017), and commit 840398f https://github.com/git/git/commit/840398feb85bc0943119c669cda266a876859818 (22 Feb 2017) by Jeff King (peff) https://github.com/peff.
Helped-by: Johannes Schindelin (dscho) https://github.com/dscho.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 92718f5 https://github.com/git/git/commit/92718f57c2e18e69bc7ae3ed18c7157c475e17a9, 10 Mar 2017)
http
: 添加一个“auto
“ 模式为http.emptyauth
这个变量(http.emptyauth
)需要指定才能使某些类型的非基本身份验证起作用,但理想情况下这对于每个人来说都是开箱即用的。
然而,只需将其设置为“1
" 默认情况下会引入额外的往返isn't有用。我们最终发送了服务器拒绝的伪造的空凭据。
“自动”模式应该使其开箱即用,而不会产生任何影响
对于访问仅限基本服务器的人来说,任何额外的往返行程。