Blame doc/functions/gnutls_session_get_data2

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {int} {gnutls_session_get_data2} (gnutls_session_t @var{session}, gnutls_datum_t * @var{data})
Packit aea12f
@var{session}: is a @code{gnutls_session_t}  type.
Packit aea12f
Packit aea12f
@var{data}: is a pointer to a datum that will hold the session.
Packit aea12f
Packit aea12f
Returns necessary parameters to support resumption. The client
Packit aea12f
should call this function and store the returned session data. A session
Packit aea12f
can be resumed later by calling @code{gnutls_session_set_data()}  with the returned
Packit aea12f
data. Note that under TLS 1.3, it is recommended for clients to use
Packit aea12f
session parameters only once, to prevent passive-observers from correlating
Packit aea12f
the different connections.
Packit aea12f
Packit aea12f
The returned  @code{data} are allocated and must be released using @code{gnutls_free()} .
Packit aea12f
Packit aea12f
This function will fail if called prior to handshake completion. In
Packit aea12f
case of false start TLS, the handshake completes only after data have
Packit aea12f
been successfully received from the peer.
Packit aea12f
Packit aea12f
Under TLS1.3 session resumption is possible only after a session ticket
Packit aea12f
is received by the client. To ensure that such a ticket has been received use
Packit aea12f
@code{gnutls_session_get_flags()}  and check for flag @code{GNUTLS_SFLAGS_SESSION_TICKET} ;
Packit aea12f
if this flag is not set, this function will wait for a new ticket within
Packit aea12f
an estimated rountrip, and if not received will return dummy data which
Packit aea12f
cannot lead to resumption.
Packit aea12f
Packit aea12f
To get notified when new tickets are received by the server
Packit aea12f
use @code{gnutls_handshake_set_hook_function()}  to wait for @code{GNUTLS_HANDSHAKE_NEW_SESSION_TICKET} 
Packit aea12f
messages. Each call of @code{gnutls_session_get_data2()}  after a ticket is
Packit aea12f
received, will return session resumption data corresponding to the last
Packit aea12f
received ticket.
Packit aea12f
Packit Service 991b93
Note that this function under TLS1.3 requires a callback to be set with
Packit Service 991b93
@code{gnutls_transport_set_pull_timeout_function()}  for successful operation. There
Packit Service 991b93
was a bug before 3.6.10 which could make this function fail if that callback
Packit Service 991b93
was not set. On later versions if not set, the function will return a successful
Packit Service 991b93
error code, but will return dummy data that cannot lead to a resumption.
Packit Service 991b93
Packit aea12f
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS}  (0) is returned, otherwise
Packit aea12f
an error code is returned.
Packit aea12f
@end deftypefun