[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gnutls] GNU TLS inside a loop: what to do at each iteration?
From: |
Stephane Bortzmeyer |
Subject: |
[Help-gnutls] GNU TLS inside a loop: what to do at each iteration? |
Date: |
Wed, 5 Nov 2003 13:12:28 +0100 |
User-agent: |
Mutt/1.5.4i |
Hello,
I'm porting echoping <URL:http://echoping.sourceforge.net/> from
OpenSSL to GNU TLS and I have a question about looping. echoping can
perform a given test repeatedly. What do I have to do at each
iteration?
I tried, at every iteration:
gnutls_transport_set_ptr (session, gnutls_transport_ptr) sockfd);
gnutls_handshake (session);
... Work
gnutls_bye (session, GNUTLS_SHUT_RDWR);
But it fails at the second iteration (-10: The specified session has
been invalidated for some reason. (Bad file descriptor)).
I then tried:
gnutls_init(&session, GNU_TLS_CLIENT);
gnutls_transport_set_ptr (session, gnutls_transport_ptr) sockfd);
gnutls_handshake (session);
... Work
gnutls_bye (channel.tls, GNUTLS_SHUT_RDWR);
gnutls_deinit (session);
And it fails at the second iteration (ASN1 parser: Element was not
found. (Bad file descriptor).
[For the record, OpenSSL has exactly the same problems and the
documentation is quite misleading.]