Elasticsearch cannot load the reindex.ssl truststore for reindex from remote
Your error
cannot read configured [PKCS12] keystore (as a truststore) [/home/es/remote-ca.p12] because access to read the file is blocked; SSL resources should be placed in the [/etc/elasticsearch] directory3 more lines it can showFix it fast
Most common cause, 1 of 3The truststore file sits outside the Elasticsearch config directory
Copy the file into a folder under the config directory and give a path relative to it.
sudo mkdir -p /etc/elasticsearch/certs
sudo cp /home/es/remote-ca.p12 /etc/elasticsearch/certs/
# /etc/elasticsearch/elasticsearch.yml
reindex.remote.whitelist: "old-cluster.example.com:9200"
reindex.ssl.truststore.path: certs/remote-ca.p12
sudo systemctl restart elasticsearch.serviceShort answer
cannot read configured [PKCS12] keystore (as a truststore) means Elasticsearch could not load the file in reindex.ssl.truststore.path. Elasticsearch 9.5 reads SSL files only inside its config directory, resolves relative paths there, and expects the store password as a secure setting. Move the file under /etc/elasticsearch, add reindex.ssl.truststore.secure_password, or trust a PEM CA instead.
Which cause do you have?
The reindex module builds its SSL context from the reindex.ssl lines in elasticsearch.yml, so look for the error in the Elasticsearch log as well as in the reindex response. Read the log line, then compare the configured path with the config directory.
sudo journalctl --unit elasticsearch | grep -E "cannot read configured|truststore" | tail -n 5
grep -n "^reindex\." /etc/elasticsearch/elasticsearch.yml
sudo ls -l /etc/elasticsearch/certs/Then find the line you see in this list and open its fix:
- 1The truststore file sits outside the Elasticsearch config directory
because access to read the file is blocked; SSL resources should be placed in the [/etc/elasticsearch] directory - 2The truststore password is missing or wrong
this is usually caused by an incorrect password, often with (no password was provided) - 3The file holds a key pair, not a trusted CA certificate
the truststore [...] does not contain any trusted certificate entries
What does the error look like?
cannot read configured [PKCS12] keystore (as a truststore) [/home/es/remote-ca.p12] because access to read the file is blocked; SSL resources should be placed in the [/etc/elasticsearch] directorycannot read configured [jks] keystore (as a truststore) [/etc/elasticsearch/remote.jks] because the file does not existthis is usually caused by an incorrect passwordthe truststore [/etc/elasticsearch/certs/node.p12] does not contain any trusted certificate entries
Cause 1 of 3
The truststore file sits outside the Elasticsearch config directory
You seebecause access to read the file is blocked; SSL resources should be placed in the [/etc/elasticsearch] directory
Check
cannot read configured keystore (as a truststore) with access to read the file is blocked means the reindex truststore lies outside the config directory, where Elasticsearch does not allow SSL files to be read. The error text itself names the directory to use, and relative paths in reindex.ssl.* are resolved against that same directory.
grep -n "reindex.ssl" /etc/elasticsearch/elasticsearch.ymlFix
Copy the file into a folder under the config directory and give a path relative to it. Remote hosts must also be allowed in reindex.remote.whitelist, which is set in the same file.
sudo mkdir -p /etc/elasticsearch/certs
sudo cp /home/es/remote-ca.p12 /etc/elasticsearch/certs/
# /etc/elasticsearch/elasticsearch.yml
reindex.remote.whitelist: "old-cluster.example.com:9200"
reindex.ssl.truststore.path: certs/remote-ca.p12
sudo systemctl restart elasticsearch.serviceVerify
The node starts without the error, and the reindex request reaches the remote cluster.
sudo journalctl --unit elasticsearch --since "10 min ago" | grep -c "cannot read configured"Confirmed by raw.githubusercontent.com
Cause 2 of 3
The truststore password is missing or wrong
You seethis is usually caused by an incorrect password, often with (no password was provided)
Check
cannot read configured keystore with this is usually caused by an incorrect password means Elasticsearch opened the file but could not decrypt it with the password it was given, or with none. The reindex docs say SSL settings go in elasticsearch.yml except the secure ones, which belong in the Elasticsearch keystore; reindex.ssl.truststore.secure_password is that secure setting, and the plain truststore.password is deprecated since 7.17.
sudo /usr/share/elasticsearch/bin/elasticsearch-keystore list | grep reindexFix
Store the truststore password in the Elasticsearch keystore under the secure name, remove any plain reindex.ssl.truststore.password line, and restart; keystore changes apply at restart.
sudo /usr/share/elasticsearch/bin/elasticsearch-keystore add reindex.ssl.truststore.secure_password
sudo systemctl restart elasticsearch.serviceVerify
keystore list shows the setting, and the startup log no longer mentions the truststore.
sudo /usr/share/elasticsearch/bin/elasticsearch-keystore listConfirmed by elastic.co
Cause 3 of 3
The file holds a key pair, not a trusted CA certificate
You seethe truststore [...] does not contain any trusted certificate entries
Check
does not contain any trusted certificate entries means reindex.ssl.truststore.path points at a store with no CA certificate in it, usually a node's own key and certificate file. For reindex from remote the truststore must hold the CA that signed the remote cluster's HTTP certificate.
keytool -list -keystore /etc/elasticsearch/certs/node.p12 -storetype PKCS12Fix
Point reindex.ssl.certificate_authorities at the remote cluster's CA in PEM form instead; it cannot be combined with truststore.path, so remove that line and its password. A store built with keytool -importcert from the CA file works too.
# /etc/elasticsearch/elasticsearch.yml
reindex.remote.whitelist: "old-cluster.example.com:9200"
reindex.ssl.certificate_authorities: [ "/etc/elasticsearch/certs/remote-ca.crt" ]
reindex.ssl.verification_mode: fullVerify
After a restart, run the reindex from remote and check that it reports created documents.
sudo systemctl restart elasticsearch.serviceConfirmed by elastic.co
How do I stop it coming back?
- Keep every reindex.ssl file under /etc/elasticsearch/certs and reference it by a relative path.
- Put SSL passwords only in the Elasticsearch keystore, using the secure_ setting names.
- Prefer reindex.ssl.certificate_authorities with the remote CA's PEM file; there is no store password to lose.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.