jcmturner / gokrb5

Pure Go Kerberos library for clients and services
Apache License 2.0
717 stars 243 forks source link

Correctly-working redirects being interpreted as redirect loops in SPNEGO HTTP client. #530

Open tzsebe opened 9 months ago

tzsebe commented 9 months ago

I was using gokrb5 to make WebHDFS requests to a Kerberized cluster, and noticed that after ~10 successful requests, the client starts returning stopped after 10 redirects for all subsequent requests.

A quick inspection shows that the client maintains all redirect requests for its lifetime, and starts emitting failures after it's encountered 10 of them total (rather than 10 for the current request).

I have a fix coded up and tested, where I allow the redirect chain to ride along with the request recursion (without modifying any exported functions). I'll put together a PR for this in the coming days, but wanted to put out this issue in case anyone has additional thoughts on this.