[gnutls-help] heartbeat procedure

Joke de Buhr joke at seiken.de
Tue Mar 26 10:25:04 CET 2013


hi,

if got a question regarding the heartbeat procedure. i'm using gnutls 3.1.10 
with heartbeat support enabled.

i established a working dtls session. i activated the heartbeat on one side 
(client) via

	gnutls_heartbeat_allowed(session, GNUTLS_HB_LOCAL_ALLOWED_TO_SEND);

and on the other side (server) i invoked

	gnutls_heartbeat_allowed(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND);

but i'm not entirely sure if that's even necessary.


the client pings the server by doing

	gnutls_heartbeat_ping(session, 100, 0, 0);

because i need/want to handle timeouts myself. the ping is send to the server 
and the server recognizes the ping as the loglevel messages indicate during 

	ret = gnutls_record_recv(...);

but value returned is -9 (GNUTLS_E_UNEXPECTED_PACKET_LENGTH) rather than -293	
(GNUTLS_E_HEARTBEAT_PING_RECEIVED).

i'm not sure if i'm using heartbeat the right way or if this is a bug. 


by the way the documentation to gnutls_heartbeat_set_timeouts() seems to be 
copied from gnutls_dtls_set_timeouts(). the description hasn't been updated 
yet.


regards
joke



More information about the Gnutls-help mailing list