Prerequisites
Note: Exceptions to this requirement can be a wildcard certificate. However, the Subject Alternative Name (SAN) should also include the Fully Qualified Domain Name of the appliance.
Generating a Certificate Signing Request (CSR):
unalias openssl
openssl genrsa -out key_filename.key 2048
openssl req -new -key key_filename.key -out certificate_request.csr
Validating the custom certificate files:
file customcert.crt
file customcert_privatekey.key
Note: replace customcert and customcert_privatekey with the actual .crt and .key names.
The below example command and the associated output means the signature is correct:
#file customcert.crt
customcert.crt: PEM certificate
#file customcert_privatekey.key
customcert_privatekey.key: PEM RSA private key - Correct
The below example command and the associated output means the signature is incorrect:
#file custcert.crt
custcert.crt: ASCII text - Incorrect
#file custcert_privatekey.key
custcert_privatekey.key: ASCII text
Note: For PFX/PB7 key, you may need to run some additional commands to get to the expected format.
----- BEGIN RSA PRIVATE KEY-----
<payload>
-----END RSA PRIVIATE KEY-----
Note: In addition, it could contain Header and Footer with some digest in between because some conversion and or exporting tools also write so called BAG ATTRIBUTES to output file. It is required or safe to remove these from the above files.
Installing a custom certificate:
consoleuser.custom-cert remove command:custom-cert remove
Removed all custom certificates.
custom-cert copy --host <IP_of_SFTP_host> --user <user_of_SFTP_host> --port 22 --path </path/to/file>.crt
custom-cert copy --host <IP_of_SFTP_host> --user <user_of_SFTP_host> --port 22 --path </path/to/file>.key
copying...
successfully copied
.crt and .key) to the folder custom_certs under /home/ubuntu/ directory and then manually delete the older Certificates as well.custom-cert list command:custom-cert list
file.crt
file.key
Above should show you the New Certificate which needs to be applied.
custom-cert apply command:custom-cert apply
Successfully applied new certificate. All active UI sessions have to be restarted.
Note: Certificates with passphrase protected keypair is not supported.
While replacing the certs, getting below error
"Failed to find the Key file"
openssl rsa -in file.key -out newfile.key
sed -i 's/-----BEGIN PRIVATE KEY-----/-----BEGIN RSA PRIVATE KEY-----/g' vrni_key.key
sed -i 's/-----END PRIVATE KEY-----/-----END RSA PRIVATE KEY-----/g' vrni_key.key