[gnutls-help] Fwd: problem with dtls heartbeat pong reception in v3.4.x

Olivier Soldano olivier.soldano at savoirfairelinux.com
Fri Sep 30 19:01:55 CEST 2016

Ok I found my mistake, you just have to use gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND | GNUTLS_HB_LOCAL_ALLOWED_TO_SEND)
for the member which is pinging and gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND) for the pong-er.

However the example code in tests/mini-dtls-heartbeat.c uses gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND); for both

moreover I found unclear the documentation http://www.gnutls.org/manual/html_node/Core-TLS-API.html#gnutls_005fheartbeat_005fenable
as it -for me- differentiates and excludes the use of the two types GNUTLS_HB_PEER_ALLOWED_TO_SEND , and GNUTLS_HB_LOCAL_ALLOWED_TO_SEND.

----- Mail original -----
De: "Olivier Soldano" <olivier.soldano at savoirfairelinux.com>
À: "gnutls-help" <gnutls-help at lists.gnutls.org>
Envoyé: Vendredi 30 Septembre 2016 09:24:17
Objet: [gnutls-help] Fwd: problem with dtls heartbeat pong reception in v3.4.x


I'm currently implementing a heartbeat sequence in my project,
and I'm encountering a few hiccups, namely trying to get a pong after a ping,
After a few investigations I diagnocised a potential error on my behalf.
I enable heartbeat with the function gnutls_heartbeat_enable(session, GNUTLS_HB_LOCAL_ALLOWED_TO_SEND) in order to be able to send pings (heartbeat.c line 171)
but this configuration generates the previous error when reaching the function 
_gnutls_heartbeat_handle (heartbeat.c line 323) due to needing the function gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND).

is it possible to configure gnutls_heartbeat_enable with both GNUTLS_HB_LOCAL_ALLOWED_TO_SEND 
and GNUTLS_HB_PEER_ALLOWED_TO_SEND at the same time?

best regards

Savoir Faire Linux
Project RING

Gnutls-help mailing list
Gnutls-help at lists.gnutls.org

More information about the Gnutls-help mailing list