``i got that error when tried to create enrollment tocken for the first time .i installed elk version 8.12.0
Try to disable security in your elasticsearch.yml config file:
xpack.security.enabled: false
Note: make sure you change your kibana.yml file accordingly with HTTP instead of HTTPS url