help-gnutls
[Top][All Lists]
Advanced

[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: Stephane Bortzmeyer
Subject: Re: [Help-gnutls] GNU TLS inside a loop: what to do at each iteration?
Date: Fri, 7 Nov 2003 14:07:21 +0100
User-agent: Mutt/1.5.4i

On Thu, Nov 06, 2003 at 12:39:39PM +0200,
 Nikos Mavroyanopoulos <address@hidden> wrote 
 a message of 37 lines which said:

> The example in section 5.2.5 (client with resume capability)
> connects to a server twice by using a loop. 

OK, my fault, I had a gnutls_global_deinit at the wrong place in the
loop. I now have the following structure:

      gnutls_global_init ();
      gnutls_certificate_allocate_credentials (&xcred);
 
      loop {
          gnutls_init (&session, GNUTLS_CLIENT);
          gnutls_set_default_priority (session);
          gnutls_certificate_type_set_priority (session,
                                                    cert_type_priority);
          gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, xcred);
          gnutls_transport_set_ptr (session,
                                        (gnutls_transport_ptr) sockfd);
          gnutls_handshake (session);
          Work ...
          shutdown()
          gnutls_bye (channel.tls, GNUTLS_SHUT_RDWR);
          gnutls_deinit (session);
      }

      gnutls_global_deinit ();

And it works fine. Many thanks.

Those who want to see it:

ftp://ftp.internatif.org/pub/unix/echoping/echoping-5.1-BETA.tar.gz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]