Hello,
I can't create an api key with the curl command in SSL.
I have tried different command without success.
Could you tell me the right command? And if I should authenticate with the node certificate or with the CA?
curl --cert-type P12 --cert certs/node-1.p12:certpassword -XPOST "https://192.168.1.10:9200/_security/api_key?pretty" -u elastic:elasticpassword -H 'Content-Type: application/json' -d'
{
"name": "my-api-key",
"role_descriptors": {
"role-a": {
"cluster": ["all"],
"index": [
{
"names": ["index-a*"],
"privileges": ["read"]
}
]
},
"role-b": {
"cluster": ["all"],
"index": [
{
"names": ["index-b*"],
"privileges": ["all"]
}
]
}
},
"metadata": {
"application": "my-application",
"environment": {
"level": 1,
"trusted": true,
"tags": ["dev", "staging"]
}
}
}
'
Best regards,