rakyll / hey

HTTP load generator, ApacheBench (ab) replacement
Apache License 2.0
17.99k stars 1.19k forks source link

Basic authentication to elasticsearch cluster fails #244

Open pantelis-karamolegkos opened 3 years ago

pantelis-karamolegkos commented 3 years ago

I have an elasticsearch cluster which I can hit as follows:

▶ curl -k https://localhost:9200 -u username:password
{
  "name" : "elasticsearch-sample-es-master-1",
  "cluster_name" : "elasticsearch-sample",
  "cluster_uuid" : "XXXXXXXXXXXXXXXXXXX",
  "version" : {
    "number" : "7.11.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "8ced7813d6f16d2ef30792e2fcde3e755795ee04",
    "build_date" : "2021-02-08T22:44:01.320463Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

(I have port-forwarded the service locally)

However when hitting it with hey

hey https://localhost:9200 -a username:password

Status code distribution:
  [401] 200 responses

Any ideas?

isarang commented 3 years ago

can you try following command? hey -a username:password https://localhost:9200

lovegnep commented 2 years ago

same problem

isarang commented 2 years ago

Try -a user:pass before url

yevgenytrcloudzone commented 2 years ago

Hi, I just wanted to update the issue is happening even if basic authentication is set before the URL. Does Hey use some other way (than cURL as a working example) to realize basic authentication?

pantelis-karamolegkos commented 2 years ago

can you try following command? hey -a username:password https://localhost:9200

This didn't solve the issue.

hengfeiyang commented 1 year ago

hey -a username:password https://localhost:9200/

This didn't solve the issue, me too.