# Securing Elasticsearch Could not resolve placeholder

**URL:** <https://discuss.elastic.co/t/securing-elasticsearch-could-not-resolve-placeholder/187040>\
**Category:** Elasticsearch\
**Created:** [June 24, 2019, 4:33am UTC](https://discuss.elastic.co/t/securing-elasticsearch-could-not-resolve-placeholder/187040 "2019-06-24T04:33:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [June 24, 2019, 4:33am UTC](https://discuss.elastic.co/t/securing-elasticsearch-could-not-resolve-placeholder/187040/1 "2019-06-24T04:33:38Z")

</div>

Testing TLS integration in a single node Elastic Stack setup. Ive run the following:

```auto
./bin/elasticsearch-keystore create
./bin/elasticsearch-keystore add certkey

```

Then added the following lines to `elasticsearch.yml`

```auto
xpack.security.fips_mode.enabled: true
xpack.security.authc.accept_default_password: false
xpack.security.authc.password_hashing.algorithm: "pbkdf2_1000"
xpack.security.authc.api_key.hashing.algorithm: "pbkdf2_1000"
xpack.security.authc.api_key.cache.hash_algo: "pbkdf2_1000"
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.supported_protocols: ["TLSv1.3", "TLSv1.2"]
xpack.security.http.ssl.cipher_suites: ["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"]
xpack.security.http.ssl.keystore.path: "c:/ES7.1/Config/elastic.pfx"
xpack.security.http.ssl.keystore.type: "PKCS#12"
xpack.security.http.ssl.keystore.secure_password: "${certkey}"
xpack.security.http.ssl.keystore.secure_key_password: "${certkey}"
xpack.security.http.ssl.truststore.path: "c:/ES7.1/Config/elastic.pfx"
xpack.security.http.ssl.truststore.type: "PKCS#12"
xpack.security.http.ssl.truststore.secure_password: "${certkey}"
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.supported_protocols: ["TLSv1.3", "TLSv1.2"]
xpack.security.transport.ssl.client_authentication: "required"
xpack.security.transport.ssl.cipher_suites: ["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"]
xpack.security.transport.ssl.keystore.path: "c:/ES7.1/Config/elastic.pfx"
xpack.security.transport.ssl.keystore.type: "PKCS#12"
xpack.security.transport.ssl.keystore.secure_password: "${certkey}"
xpack.security.transport.ssl.keystore.secure_key_password: "${certkey}"
xpack.security.transport.ssl.truststore.path: "c:/ES7.1/Config/elastic.pfx"
xpack.security.transport.ssl.truststore.type: "PKCS#12"
xpack.security.transport.ssl.truststore.secure_password: "${certkey}"

```

However, when starting elasticsearch, the following error appears.

```auto
Exception in thread "main" java.lang.IllegalArgumentException: Could not resolve placeholder 'certkey'
        at org.elasticsearch.common.settings.PropertyPlaceholder.parseStringValue(PropertyPlaceholder.java:116)
        at org.elasticsearch.common.settings.PropertyPlaceholder.replacePlaceholders(PropertyPlaceholder.java:69)
        at org.elasticsearch.common.settings.Settings$Builder.replacePropertyPlaceholders(Settings.java:1162)
        at org.elasticsearch.common.settings.Settings$Builder.replacePropertyPlaceholders(Settings.java:1118)
        at org.elasticsearch.node.InternalSettingsPreparer.initializeSettings(InternalSettingsPreparer.java:112)
        at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:90)
        at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:95)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

```

Where am I going wrong?

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [June 24, 2019, 12:40pm UTC](https://discuss.elastic.co/t/securing-elasticsearch-could-not-resolve-placeholder/187040/2 "2019-06-24T12:40:17Z")

</div>

Elasticsearch works a bit different than the other elastic products in regard to the keystore:  
Instead of referencing a key alias which is defined in the keystore elasticsearch only supports specific fields to be added to the keystore. [Those are specially marked in the settings documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html)

As example the [keystore settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#_java_keystore_files_2):  
Instead of filling the field xpack.security.http.ssl.keystore.password remove the line completely and just set the key xpack.security.http.ssl.truststore.secure\_password in the keystore.

This means for you:

- remove the secure\_\* entries from your config
- add the secure\_\* entries to your keystore

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 22, 2019, 12:40pm UTC](https://discuss.elastic.co/t/securing-elasticsearch-could-not-resolve-placeholder/187040/3 "2019-07-22T12:40:33Z")

</div>

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