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

# OSSL\_SELF\_TEST\_set\_callback(3ssl)

specify a callback for processing self tests

## NAME

OSSL\_SELF\_TEST\_set\_callback, OSSL\_SELF\_TEST\_get\_callback - specify a callback for processing self tests

## SYNOPSIS

```
 #include <openssl/self_test.h>
 void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *ctx, OSSL_CALLBACK *cb, void *cbarg);
 void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg);
```

## DESCRIPTION

Set or gets the optional application callback (and the callback argument) that is called during self testing. The application callback **OSSL\_CALLBACK**(3) is associated with a **OSSL\_LIB\_CTX**. The application callback function receives information about a running self test, and may return a result to the calling self test. See **openssl-core.h**(7) for further information on the callback.

## RETURN VALUES

**OSSL\_SELF\_TEST\_get\_callback()** returns the callback and callback argument that has been set via **OSSL\_SELF\_TEST\_set\_callback()** for the given library context *ctx*. These returned parameters will be NULL if **OSSL\_SELF\_TEST\_set\_callback()** has not been called.

## SEE ALSO

**openssl-core.h**(7), **OSSL\_PROVIDER-FIPS**(7) **OSSL\_SELF\_TEST\_new**(3) **OSSL\_LIB\_CTX**(3)

## HISTORY

The functions described here were added in OpenSSL 3.0.

## COPYRIGHT

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