---
name: "libressl-OCSP_SERVICELOC_new"
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-OCSP_SERVICELOC_new"
---

# libressl-OCSP\_SERVICELOC\_new(3)

OCSP service locator extension

## NAME

**OCSP\_SERVICELOC\_new**, **OCSP\_SERVICELOC\_free**, **OCSP\_url\_svcloc\_new** – OCSP service locator extension

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*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

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 a *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

OCSP\_REQUEST\_new(3), X509\_EXTENSION\_new(3), X509\_get1\_ocsp(3), X509\_get\_issuer\_name(3), X509\_NAME\_new(3)

## 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.
