Optional HTTP authentication against the ElasticSearch HTTP server

This is needed if you have put a proxy before your ElasticSearch
server that uses HTTPS and Basic Auth to protect access to the
ElasticSearch server.

Due to a "go fmt" run this diff is a little longer than absolutely necessary.