How to add elasticsearch as a datasource when username and password are available for ES?

I set up x-pack, to provide an extra layer of security to Elasticsearch and now I am unable to use elasticsearch as a data source anymore… All I can see is a red alarming signal, showing that grafana failed to add the elasticsearch as a data source.
I provided the URL as, http://elastic:changeme@localhost:9200

Does xpack support basic auth, did you check basic auth option and specified username and password?