I am trying to get the Hashicorp Vault UI to use HTTPS. I have a certificate from Godaddy which works on the same machine in apache2.
My vault.hcl file looks as follows
# HTTPS listener
listener "tcp" {
address = "0.0.0.0:8200"
tls_cert_file = "/godaddy_certs/123xxx321.crt"
tls_key_file = "/godaddy_certs/privatekey.key"
tls_disable = "false"
}
However I read here that I cannot simply use the certificate that was provided by Godaddy. That reference says the following:
To configure the listener to use a CA certificate, concatenate the primary certificate and the CA certificate together. The primary certificate should appear first in the combined file.
Now I am assuming that the “primary certificate” referred to here is the 123xxx321.crt file that was provided from Godaddy. Godaddy also include a gd_bundle-g2-g1.crt file.
So I thought I could just create a new file called myVaultCert.crt and copy the PEM string from 123xxx321.crt which looks like this:
-----BEGIN CERTIFICATE-----
MIIG ... /0I=
-----END CERTIFICATE-----
into the top position and then afterwards copy the PEM string from the gd_bundle-g2-g1.crt file.
So myVaultCert.crt now looks something like
-----BEGIN CERTIFICATE-----
MIIG36F ... /0I=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEADC ... v08=
-----END CERTIFICATE-----
I change my vault.hcl config to look as follows:
# HTTPS listener
listener "tcp" {
address = "0.0.0.0:8200"
tls_cert_file = "/godaddy_certs/myVaultCert.crt"
tls_key_file = "/godaddy_certs/privatekey.key"
tls_disable = "false"
}
When I run sudo systemctl start vault.service
I get the following returned:
Job for vault.service failed because the control process exited with error code. See “systemctl status vault.service” and “journalctl -xe” for details.
When I check journalctl -xe
I see this
Error initializing listener of type tcp: error loading TLS cert: decoded PEM is blank
So I went to Godaddy and saw there is a repository with links to root certificates and bundles etc etc. I have tried to copy the certificate that was provided folowed by several Certificates found in that repository but they all give me the same error.
What certificates must I concatenate so that I can use a Godaddy certificate with Hashicorp Vault?