[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gnutls] GNU TLS inside a loop: what to do at each iteration?
From: |
Nikos Mavroyanopoulos |
Subject: |
Re: [Help-gnutls] GNU TLS inside a loop: what to do at each iteration? |
Date: |
Thu, 6 Nov 2003 11:12:20 +0200 |
User-agent: |
Mutt/1.5.4i |
On Wed, Nov 05, 2003 at 01:12:28PM +0100, Stephane Bortzmeyer wrote:
> Hello,
> 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)).
Yes, this is not a correct use of a gnutls session.
> 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).
You probably haven't called gnutls_global_init(). In any case try reading
the examples on how to properly initialize a TLS session.
--
Nikos Mavroyanopoulos