Hello dear JGit devs,
I have come here to bring a patch for an old bug that might have never been reported.
We might see in the internet it is very hard to get JGit to connect to a TFS server, but today I have found the reason.
It is because ofÂHttpClientConnection.getHeaderFields. If a server replies with multiple WWW-Authenticate, it will consider only the last value read.
Except the correct behavior is to provide a list of all the values if same header key.
Because of this bug JGit will not even try other authentication methods if NTLM is the last one in the response header.
I have patched this with a Pull Request, that I kindly ask to be accepted:
I also have workarounds provided if anyone is facing a similar issue, and can't wait for the fix: