Fixed issues related to http client v2.5

@adamedx  @NimishaS  @kaustubh-d 

I've fixed issues related to new httpclient(v2.5). 
Also tested and it works fine on both httpclient v2.4 and v.25 .
@siddheshwar-more  - I feel we should still have this check, as in new httpclient there is a delayed check here https://github.com/nahi/httpclient/blob/master/lib/httpclient/auth.rb#L641