Forum Discussion
4 Replies
Sort By
- Lee_SutcliffeNacreous
This should work to return the common name in the subject. You may want to experiment with line numbers before to display the cert name too
tmsh list sys file ssl-cert | grep my-common-name
- MehulTNimbostratus
You can also try to get all the related information on that particular certificate
tmsh list sys file ssl-cert one-line | grep my-common-name
- SeylerNimbostratus
The awk snippet works for extracting the different parts, but you still need to know which section is the key / cert / chain. I needed to extract a specific section, and found this on the OpenSSL mailinglist.
- Andy_McGrathCumulonimbus
If you have certs on partitions other than 'Common' use the following from bash:
tmsh list sys file ssl-cert '/*/*' one-line | grep my-common-name
If you want to just output the file name do the following:
tmsh list sys file ssl-cert '/*/*' one-line | grep my-common-name | awk '{print $4}'