0

我有一个elasticsearch集群,我可以点击如下:

▶ 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"
}

(我已在本地端口转发服务)

然而,当用嘿击中它时

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

Status code distribution:
  [401] 200 responses

有任何想法吗?

4

1 回答 1

0

您可以尝试以下方法

hey https://username:password@localhost:9200

这样可行!

注意:官方hey存储库中有未解决的问题,https://github.com/rakyll/hey/issues/150

于 2021-12-03T18:48:42.197 回答