Problem with logstash output to elastic via ssl

I regenerate certs, with ip. and it work. But logstash can not create template

[ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"Got response code '403' contacting Elasticsearch at URL 'https://127.0.0.1:9200/_template/logstash