Skip to content
ecdsa.com
OpenSSL 3.x CLI (openssl s_client / openssl verify)OpenSSL CLI

Error message

verify error:num=79:invalid CA certificate

Also printed as

  • error 79 at 1 depth lookup: invalid CA certificate

OpenSSL 3.0.13 and 3.5.7 both report this case as error 79 (older references list "invalid CA certificate" as error 24, which still exists for other CA checks). s_client also prints error 26, "unsuitable certificate purpose", for the same certificate, and its summary line shows that last code.

OpenSSL 3.x CLI (openssl s_client / openssl verify) — X509_V_ERR_INVALID_CA

What it means

OpenSSL error 79 (X509_V_ERR_INVALID_CA): a certificate that sits in an issuer position of the chain is not a valid CA certificate — its basicConstraints say CA:FALSE or are missing, or its keyUsage does not allow certificate signing. The depth in the openssl verify message points at the offending certificate (1 is the first intermediate).

Why it happens

How to fix it

  1. 1.

    Inspect the certificate at the reported depth

    basicConstraints must be CA:TRUE (critical) and keyUsage must include keyCertSign.

    bash
    # The certificate at the depth named in the error must be a CA
    openssl x509 -in int.pem -noout -subject -ext basicConstraints,keyUsage
  2. 2.

    Reissue the intermediate as a CA

    Re-sign it with CA extensions; certificates it issued stay valid if the key and subject are unchanged.

    bash
    printf 'basicConstraints=critical,CA:TRUE,pathlen:0\nkeyUsage=critical,keyCertSign,cRLSign\n' > ca.ext
    openssl x509 -req -in int.csr -CA root.pem -CAkey root.key -days 1825 -extfile ca.ext -out int.pem

Related errors

Browse the full signature error database