Unable to delete identity in Keychain

0
1
Unable to delete identity in Keychain


A certificate that we use for Wi-Fi in the office has expired, and it does not renew for some reason. I tried to delete it from the Keychain Access I get the following error:

Unable to delete identity in Keychain

I guess that’s the reason why the certificate is not being renewed.

I tried the same from terminal as well. When I try to find it using its name, it finds and shows that it is not valid.

$> security find-identity  "XXXXXXXoffice"  /Users/username/Library/Keychains/login.keychain-db


Policy: X.509 Basic
  Matching identities
  1) F0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX30 "localhost" (CSSMERR_TP_CERT_EXPIRED)
  2) E9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXC9 "4ab2f0ae-76fd-4636-a899-c4e89b8386d1" (CSSMERR_TP_NOT_TRUSTED)
     2 identities found

  Valid identities only
     0 valid identities found

When I try to delete it though, I get an error, just like I get from the Keychain Access.

security delete-identity -c "XXXXXXXoffice"  /Users/username/Library/Keychains/login.keychain-db
Unable to delete certificate matching "XXXXXXXoffice"%

Any suggestions on how I can delete this keychain identity?