# What Is Basic Constraints (basicConstraints extension)?

> Basic Constraints is the X.509 extension that states whether a certificate belongs to a CA and, optionally, how many CA levels may appear below it.

Source: https://ssl.sh/glossary/basic-constraints/
Last updated: 2026-11-10

Basic Constraints has two fields: `cA`, a boolean, and an optional `pathLenConstraint`. When `cA` is true, the certificate's key may sign other certificates, together with the keyCertSign [key usage](https://ssl.sh/glossary/key-usage/); the path length limits how many further intermediate CAs may follow it in a chain. RFC 5280 requires the extension, marked critical, in all CA certificates, while end-entity certificates either omit it or set `CA:FALSE`.

## Why it matters
This flag is what stops a website's certificate from acting as a CA. Early TLS implementations that failed to check it let anyone holding an ordinary certificate mint certificates for other domains, a lesson that made the check universal in [X.509](https://ssl.sh/glossary/x509/) path validation. It also explains real errors: a server certificate generated with `CA:TRUE` can be rejected by Firefox with MOZILLA_PKIX_ERROR_CA_CERT_USED_AS_END_ENTITY, and a [subordinate CA](https://ssl.sh/glossary/subordinate-ca/) with `pathlen:0` cannot issue another intermediate.

## Example
```text
X509v3 Basic Constraints: critical
    CA:TRUE, pathlen:0
```

This is how `openssl x509 -noout -text` shows a CA that may issue only end-entity certificates. A leaf certificate shows `CA:FALSE`.

## Common misconceptions
- **pathlen:0 means the CA cannot issue anything.** It can issue end-entity certificates; it just cannot issue further CA certificates.
- **Every self-signed certificate should be a CA.** A self-signed root needs `CA:TRUE`, but a self-signed certificate used directly as a server certificate should not have it.

## Related terms

- [X.509](https://ssl.sh/zh/glossary/x509/): X.509 是 ITU-T 制定的公钥证书标准格式，其互联网配置规范 RFC 5280 规定了 TLS 所用证书的结构和验证方法。
- [下级 CA](https://ssl.sh/zh/glossary/subordinate-ca/): 下级 CA 是 CA 证书由另一个 CA（通常是根 CA）签发的证书颁发机构，一般负责实际签发终端证书。
- [中间证书](https://ssl.sh/zh/glossary/intermediate-certificate/): 中间证书是由根证书（或上级中间证书）签发、用来签发网站证书的 CA 证书，服务器必须把它和网站证书一起发送给客户端。
- [根证书](https://ssl.sh/zh/glossary/root-certificate/): 根证书是位于证书链顶端、由 CA 自签名的证书，预装在操作系统或浏览器的信任库中，作为验证其他证书的信任锚。
- [名称约束](https://ssl.sh/zh/glossary/name-constraints/): 名称约束是 CA 证书中的 X.509 扩展，用来限定该 CA 之下签发的证书只能包含哪些域名、IP 段、邮箱或 DN。
- [密钥用途](https://ssl.sh/zh/glossary/key-usage/): 密钥用途是 X.509 证书扩展，限定证书公钥可执行的密码学操作，例如数字签名、密钥加密或签发证书。
