I want to get CA certificate from the vault but get an error in response to API call.
$ vault read rootpki/ca/pem
Error reading rootpki/ca/pem: invalid character '-' in numeric literal
Environment
$ vault version
Vault v0.4.0
$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
$ uname -a
Linux localhost.localdomain 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Hi @lexsys27
As noted in the documentation for that endpoint:
Retrieves the CA certificate in raw DER-encoded form. This is a bare endpoint that does not return a standard Vault data structure.
You want to be using rootpki/cert/ca.
If /pem is added to the endpoint, the CA certificate is returned in PEM format.
Doesn't this change format to pem?
PEM is still not a format parseable by the Vault CLI. If using the Vault CLI you must use the endpoint I indicated.
Most helpful comment
Hi @lexsys27
As noted in the documentation for that endpoint:
You want to be using
rootpki/cert/ca.