Documentation of elasticsearch-certutil is wrong for parameter --pass

(Sven Schliesing) #1

The documentation states that

If you want to specify a blank password (without prompting), use --pass "" (with no =).

But that seems to be wrong:

$ /usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --silent -in /etc/elasticsearch/instances.yml --out /tmp/ --pass ""
Exception in thread "main" java.lang.IllegalArgumentException: password empty
        at org.bouncycastle.jcajce.provider.symmetric.OpenSSLPBKDF$PBKDF.engineGenerateSecret(Unknown Source)
        at javax.crypto.SecretKeyFactory.generateSecret(
        at org.bouncycastle.openssl.jcajce.PEMUtilities.getKey(Unknown Source)
        at org.bouncycastle.openssl.jcajce.PEMUtilities.crypt(Unknown Source)
        at org.bouncycastle.openssl.jcajce.JcePEMEncryptorBuilder$1.encrypt(Unknown Source)
        at org.bouncycastle.openssl.MiscPEMGenerator.createPemObject(Unknown Source)
        at org.bouncycastle.openssl.MiscPEMGenerator.generate(Unknown Source)
        at Source)
        at org.bouncycastle.openssl.jcajce.JcaPEMWriter.writeObject(Unknown Source)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(
        at org.elasticsearch.cli.MultiCommand.execute(
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(
        at org.elasticsearch.cli.Command.main(

Not specifying the parameter at all works, though:

$ /usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --silent -in /etc/elasticsearch/instances.yml --out /tmp/

Installed version: 6.4.2 (

(Gordon Brown) #2

Thanks for noticing this and reporting it!

Could I ask you to open an issue on the Elasticsearch repository about this? We use GitHub to track bugs (including documentation bugs!) and it's most likely to get fixed if there's an open issue about it.

(Sven Schliesing) #3

Thanks for your quick reply! :+1:

(Tim Vernum) #4

The documentation is not very clear, but it's technically correct. (I say that not to be argumentative, just to explain what is happening here).

--pass "" does indeed specify a blank password. But PEM files don't support blank passwords, so you get the error that you saw.

Note that a blank password is different than "no password". You can have a PEM file with no password (an unencrypted key) but you cannot have one that is encrypted with the blank password.

That's different for PKCS#12, where you are required to have a password, but it is allowed to be blank.

I'll get the docs updated to be more clear about this, but if you just want a PEM file with no password, don't specify --pass at all.

(system) #5

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