---
name: "NCONF_new_ex"
section: "3ssl"
platform: "linux"
package: "openssl"
version: "3.6.5-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/NCONF_new_ex"
---

# NCONF\_new\_ex(3ssl)

functionality to Load and parse configuration files manually

## NAME

NCONF\_new\_ex, NCONF\_new, NCONF\_free, NCONF\_default, NCONF\_load, NCONF\_get0\_libctx, NCONF\_get\_section, NCONF\_get\_section\_names - functionality to Load and parse configuration files manually

## SYNOPSIS

```
 #include <openssl/conf.h>
 typedef struct {
     char *section;
     char *name;
     char *value;
 } CONF_VALUE;
 CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
 CONF *NCONF_new(CONF_METHOD *meth);
 void NCONF_free(CONF *conf);
 CONF_METHOD *NCONF_default(void);
 int NCONF_load(CONF *conf, const char *file, long *eline);
 OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf);
 STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *name);
 STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf);
```

## DESCRIPTION

**NCONF\_new\_ex()** creates a new CONF object in heap memory and assigns to it a context *libctx* that can be used during loading. If the method table *meth* is set to NULL then the default value of **NCONF\_default()** is used.

**NCONF\_new()** is similar to **NCONF\_new\_ex()** but sets the *libctx* to NULL.

**NCONF\_free()** frees the data associated with *conf* and then frees the *conf* object. If the argument is NULL, nothing is done.

**NCONF\_load()** parses the file named *filename* and adds the values found to *conf*. If an error occurs *file* and *eline* list the file and line that the load failed on if they are not NULL.

**NCONF\_default()** gets the default method table for processing a configuration file.

**NCONF\_get0\_libctx()** gets the library context associated with the *conf* parameter.

**NCONF\_get\_section\_names()** gets the names of the sections associated with the *conf* as **STACK\_OF(OPENSSL\_CSTRING)** strings. The individual strings are associated with the *conf* and will be invalid after *conf* is freed. The returned stack must be freed with **sk\_OPENSSL\_CSTRING\_free()**.

**NCONF\_get\_section()** gets the config values associated with the *conf* from the config section *name* as **STACK\_OF(CONF\_VALUE)** structures. The returned stack is associated with the *conf* and will be invalid after *conf* is freed. It must not be freed by the caller.

## RETURN VALUES

**NCONF\_load()** returns 1 on success or 0 on error.

**NCONF\_new\_ex()** and **NCONF\_new()** return a newly created *CONF* object or NULL if an error occurs.

## SEE ALSO

**CONF\_modules\_load\_file**(3),

## HISTORY

**NCONF\_new\_ex()**, **NCONF\_get0\_libctx()**, and **NCONF\_get\_section\_names()** were added in OpenSSL 3.0.

## COPYRIGHT

Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use this file except in compliance with the License.  You can obtain a copy in the file LICENSE in the source distribution or at \<https://www.openssl.org/source/license.html\>.
