I'm using HttpClient 4.1.1 and i'm performing multiple requests to several web servers (using nutch 2.x) that requires authentication.
I've read that I can save the authentication state between calls by passing the same HttpContext but that I shouldn't reuse the same HttpContext between different threads. So in effect i'll have to authenticate from every thread. i can use the SyncBasicHttpContext but without knowing exactly how nutch is using it I won't be able to know if its indeed safe to use it or not. Is there a chance that the HttpClient itself is using the SyncBasicHttpContext in an unsafe manner? To my understanding Nutch reuses the HttpClient between all threads but to maintain the authentication state for multiple hosts I will have to maintain a map between a host and its HttpContext. Is there a similar capability built into HttpClient that can do that or do I need to use my own Map? A simple Map between a host and an HttpContext is enough?