---
name: "libressl-X509_verify_cert"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-X509_verify_cert"
---

# libressl-X509\_verify\_cert(3)

discover and verify X509 certificate chain

## NAME

**X509\_verify\_cert** – discover and verify X509 certificate chain

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/x509.h\>**

*int*\

**X509\_verify\_cert**(*X509\_STORE\_CTX \*ctx*);

## DESCRIPTION

The **X509\_verify\_cert**() function attempts to discover and validate a certificate chain based on parameters in *ctx*.

Applications rarely call this function directly, but it is used by OpenSSL internally for certificate validation, in both the S/MIME and SSL/TLS code.

## RETURN VALUES

If a complete chain can be built and validated this function returns 1, otherwise it returns a value \<= 0 indicating failure.

Additional error information can be obtained by examining *ctx*, using X509\_STORE\_CTX\_get\_error(3).

## SEE ALSO

[openssl(1)](/openssl/1.md), X509\_STORE\_CTX\_get\_error(3), X509\_STORE\_CTX\_new(3)

## HISTORY

**X509\_verify\_cert**() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4.

## BUGS

This function uses the header ⟨openssl/x509.h⟩ as opposed to most chain verification functions which use ⟨openssl/x509\_vfy.h⟩.
