[Help-gnutls] GNU TLS inside a loop: what to do at each iteration?

Nikos Mavroyanopoulos nmav at gnutls.org
Thu Nov 6 11:39:39 CET 2003


On Thu, Nov 06, 2003 at 10:31:26AM +0100, Stephane Bortzmeyer wrote:

> > > 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(). 
> Of course I did. I just showed only the instructions that are
> loop-specific but, at the beginning of the program, before starting
> the loop, I have:
>       gnutls_global_init ();
>       gnutls_certificate_allocate_credentials (&xcred);
> > In any case try reading the examples on how to properly initialize a
> > TLS session.
> No example on the Web site covers the case of a loop.

The example in section 5.2.5 (client with resume capability)
connects to a server twice by using a loop. If this doesn't help
either use the following to get more detailed error reporting, or
send a small program to reproduce the error.

static void tls_log_func( int level, const char* str)
{
        fprintf(stderr, "|<%d>| %s", level, str);
}

gnutls_global_set_log_function( tls_log_func);
gnutls_global_set_log_level(2);

-- 
Nikos Mavroyanopoulos





More information about the Gnutls-help mailing list