---
name: "gnutls_session_set_finished_function"
section: "3"
platform: "linux"
package: "gnutls-doc"
version: "2.8.6-1+squeeze3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/gnutls_session_set_finished_function"
---

# gnutls\_session\_set\_finished\_function(3)

API function

## NAME

gnutls\_session\_set\_finished\_function - API function

## SYNOPSIS

**#include \<gnutls/gnutls.h\>**

**void gnutls\_session\_set\_finished\_function(gnutls\_session\_t** *session***, gnutls\_finished\_callback\_func** *func***);**

## ARGUMENTS

- gnutls\_session\_t session

  is a **gnutls\_session\_t** structure.

- gnutls\_finished\_callback\_func func

  a **gnutls\_finished\_callback\_func** callback.

## DESCRIPTION

Register a callback function for the session that will be called when a TLS Finished message has been generated.  The function is typically used to copy away the TLS finished message for later use as a channel binding or similar purpose.

## THE CALLBACK SHOULD FOLLOW THIS PROTOTYPE

void callback (gnutls\_session\_t *session*, const void \**finished*, size\_t *len*);

The *finished* parameter will contain the binary TLS finished message, and *len* will contains its length.  For SSLv3 connections, the *len* parameter will be 36 and for TLS connections it will be 12.

It is recommended that the function returns quickly in order to not delay the handshake.  Use the function to store a copy of the TLS finished message for later use.

## SINCE

2\.6.0

## REPORTING BUGS

Report bugs to \<bug-gnutls@gnu.org\>. GnuTLS home page: http://www.gnu.org/software/gnutls/ General help using GNU software: http://www.gnu.org/gethelp/

## COPYRIGHT

Copyright © 2008 Free Software Foundation.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

## SEE ALSO

The full documentation for **gnutls** is maintained as a Texinfo manual.  If the **info** and **gnutls** programs are properly installed at your site, the command

-

  **info gnutls**

should give you access to the complete manual.
