OCSP_SERVICELOC_NEW(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… OCSP_SERVICELOC_NEW(3) β€” Library Functions Manual

Okay bestie, welcome to OCSP_SERVICELOC_NEW(3) β€” the OCSP service locator extension page. This is giving β€œtiny libcrypto helper with main character energy,” and we are seated. ✨


πŸŽ€ NAME πŸŽ€

Three functions, one whole vibe: OCSP_SERVICELOC_new, OCSP_SERVICELOC_free, and OCSP_url_svcloc_new β€” all for the OCSP service locator extension. πŸ’–


🌸 SYNOPSIS 🌸

First, the library situation:

library β€œlibcrypto” #include <openssl/ocsp.h>

Then the function signatures, exactly as they are:

OCSP_SERVICELOC *
OCSP_SERVICELOC_new(void);

void
OCSP_SERVICELOC_free(OCSP_SERVICELOC *sloc);

X509_EXTENSION *
OCSP_url_svcloc_new(X509_NAME *issuer, const char **urls);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here’s the networking tea: due to restrictions of network routing, a client may be unable to directly contact the authoritative OCSP server for a certificate that needs to be checked. 😭 In that case, the request can be sent via a proxy server. An ASN.1 ServiceLocator structure is included in the singleRequestExtensions field of the Request structure to indicate where to forward the request. The ServiceLocator is represented by an OCSP_SERVICELOC object, which will be stored inside the OCSP_ONEREQ object documented in OCSP_ONEREQ_new(3). 🫢

  • OCSP_SERVICELOC_new() β€” allocates and initializes an empty OCSP_SERVICELOC object. ✨
  • OCSP_SERVICELOC_free() β€” frees sloc.

OCSP_url_svcloc_new() requires an issuer name and optionally accepts an array of urls. If urls or its first element is NULL, the locator field is omitted from the ServiceLocator structure and only the issuer is included. The resulting ServiceLocator structure is encoded in ASN.1 using X509V3_EXT_i2d(3) with criticality 0. πŸ’…


🌈 RETURN VALUES 🌈

OCSP_SERVICELOC_new() returns a new OCSP_SERVICELOC object or NULL if an error occurred. 🫑

OCSP_url_svcloc_new() returns a new X509_EXTENSION object or NULL if an error occurred. πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘


⭐ STANDARDS ⭐

RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.4.6: Service Locator. πŸ“š


πŸ’œ HISTORY πŸ’œ

OCSP_SERVICELOC_new(), OCSP_SERVICELOC_free(), and OCSP_url_svcloc_new() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. πŸ¦‹


xoxo, this page is from Debian, dated June 8, 2025, and filed under OCSP_SERVICELOC_NEW(3). πŸ’–

πŸ“¦ where this page comes from