gnutls_session_set_verify_function(3)

gnutls_session_set_verify_function3

Api function

Usage

#include <gnutls/gnutls.h>

void gnutls_session_set_verify_function(gnutls_session_t session, gnutls_certificate_verify_function * func);

Arguments

gnutls_session_t session

is a gnutls_session_t type.

gnutls_certificate_verify_function * func

is the callback function

Overview

This function sets a callback to be called when peer's certificate has been received in order to verify it on receipt rather than doing after the handshake is completed. This overrides any callback set using gnutls_certificate_set_verify_function().

The callback's function prototype is: int (*callback)(gnutls_session_t);

If the callback function is provided then gnutls will call it, in the handshake, just after the certificate message has been received. To verify or obtain the certificate the gnutls_certificate_verify_peers2(), gnutls_certificate_type_get(), gnutls_certificate_get_peers() functions can be used.

The callback function should return 0 for the handshake to continue or non-zero to terminate.

Since

3.4.6

Releases

6 releases since Debian 9 (Stretch); the text changed 5 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13
  6. Arch

Reporting bugs

Report bugs to <[email protected]>.
Home page: https://www.gnutls.org

From gnutls 3.8.13-3 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.