27-Sep-2022 01:46
greetings all,
is there any way to check the ssl certificate status, validation, expiration date using rest api on the bigip?
thank you
Solved! Go to Solution.
29-Sep-2022 01:55
forget to add your cert expiry output will be like
curl -sku admin:admin https://bigip_hostname/mgmt/tm/sys/crypto/cert/ | jq '.items[] | {certname: .name, CertExpiry: .apiRawValues.expiration}'
{
"certname": "/Common/abc_host_certJuly2022",
"CertExpiry": "Jul 14 17:11:26 2021 GMT"
}
27-Sep-2022 02:28 - edited 27-Sep-2022 02:29
As such there is no direct RestAPI commnd but you can customise based on your requiremnt. Like tmsh there is comamnd to retrive the cert name n cert validity.
tmsh list sys crypto cert
RestAPI you can try something like below.
curl -sku admin:admin https://bigip_hostname/mgmt/tm/sys/crypto/cert/ | jq '.items[] | {certname: .name, CertExpiry: .apiRawValues.expiration}'
Hope it will help you
27-Sep-2022 21:55
hi @Samir
thank you for your reply, actually my customer has ask me about the rest api to detect the certificate expiration using ansible, because of that i need command to check regarding this.
29-Sep-2022 01:55
forget to add your cert expiry output will be like
curl -sku admin:admin https://bigip_hostname/mgmt/tm/sys/crypto/cert/ | jq '.items[] | {certname: .name, CertExpiry: .apiRawValues.expiration}'
{
"certname": "/Common/abc_host_certJuly2022",
"CertExpiry": "Jul 14 17:11:26 2021 GMT"
}
11-Oct-2022 00:34
hi @Samir
thank you, it works