- NAME
- SYNOPSIS
- DESCRIPTION
- RETURN VALUES
- HISTORY
- COPYRIGHT

# NAME

OPENSSL_CTX, OPENSSL_CTX_new, OPENSSL_CTX_free - OpenSSL library context

# SYNOPSIS

     #include <openssl/crypto.h>

     typedef struct openssl_ctx_st OPENSSL_CTX;

     OPENSSL_CTX *OPENSSL_CTX_new(void);
     void OPENSSL_CTX_free(OPENSSL_CTX *ctx);

# DESCRIPTION

`OPENSSL_CTX` is an internal OpenSSL library context type. Applications may allocate their own, but may also use `NULL` to use the internal default context with functions that take a `OPENSSL_CTX` argument.

`OPENSSL_CTX_new()` creates a new OpenSSL library context. When a non default library context is in use care should be taken with multi-threaded applications to properly clean up thread local resources before the OPENSSL_CTX is freed. See OPENSSL_thread_stop_ex(3) for more information.

`OPENSSL_CTX_free()` frees the given `ctx`.

# RETURN VALUES

`OPENSSL_CTX_new()` return a library context pointer on success, or `NULL` on error.

`OPENSSL_CTX_free()` doesn't return any value.

# HISTORY

OPENSSL_CTX, `OPENSSL_CTX_new()` and `OPENSSL_CTX_free()` were added in OpenSSL 3.0.

# COPYRIGHT

Copyright 2019 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.