Getting wrong method GET for _ssl/certificates ES 7.17

Has anyone seen this? It works fine on my 8.x clusters ...

 # curl -X GET "localhost:9200/_ssl/certificates?pretty"
{
  "error" : "Incorrect HTTP method for uri [/_ssl/certificates?pretty] and method [GET], allowed: [POST]",
  "status" : 405
}

Documentation doesn't mention a "POST" at all SSL certificate API | Elasticsearch Guide [7.17] | Elastic

Hi @Doc_Kaos Interesting...

Did you mean https://localhost:9200...
Do you have certs?

I run the following on my 7.17.13 and works

# GET /
{
  "name" : "instance-0000000000",
  "cluster_name" : "dsfgsdfg54a3fbc1e14cf595222d2",
  "cluster_uuid" : "sfdsfdsfsdgdsfgd",
  "version" : {
    "number" : "7.17.13",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "2b211dbb8bfdecaf7f5b44d356bdfe54b1050c13",
    "build_date" : "2023-08-31T17:33:19.958690787Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

# GET _ssl/certificates?pretty
[
  {
    "path" : "internal_tls_ca.crt",
    "format" : "PEM",
    "alias" : null,
    "subject_dn" : "CN=elastic ce internal tls root",
    "serial_number" : "1dfgdfg3c764f12",
    "has_private_key" : false,
    "expiry" : "2031-09-29T15:25:58.000Z"
  }
1 Like

That's what I was trying to check :smiley: "Do I have any certs?" :smiley:

I can use Kibana dev tools to get the same thing as well. So if you have none, it responds with wrong method instead of an empty response?

Hello,

I have checked this question on a http cluster with 7.x it responds with an empty list.

1 Like

Same Here

hyperion:config sbrown$ curl http://localhost:9200/_ssl/certificates
[]
1 Like

Weird. I'll try updating maybe:

"version" : {
    "number" : "7.17.10",
    "build_flavor" : "default",
    "build_type" : "deb",

Discovered this happens if you have transport.ssl settings, but didn't enable xpack.security :smiley:

1 Like

That's correct.
If security is not enabled then the _ssl/certificates API does not exist. and the error message you are getting is due to the fact that Elasticsearch thinks you're trying to create a document in the _ssl index.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.