0

I have working code where two peers are connecting over a relay server (coturn) and everything seems to be fine over pseudo-tcp. I've tested message exchange successfully with nice_agent_attach_recv() and nice_agent_get_io_stream().

But when I try to create a GTlsClientConnection I get back: 0:TLS support is not available

Here is some partial code:

   if(!nice_agent_set_relay_info(agent, stream_id, 
       NICE_COMPONENT_TYPE_RTP, 
       "my.coturn.server", 
       5349, //tls-listener-port (I also tried the non tls port: 3478)
       username.c_str(), 
       password.c_str(), 
       NICE_RELAY_TYPE_TURN_TCP)) 
   {
        printf("error setting up relay info\n");
   }

   ...

   //after state has changed to NICE_COMPONENT_STATE_READY

   ...

   io_stream = nice_agent_get_io_stream (agent, stream_id, component_id);
   input = g_io_stream_get_input_stream (G_IO_STREAM (io_stream));
   output = g_io_stream_get_output_stream (G_IO_STREAM (io_stream));

   GIOStream* tlsConnection  = g_tls_client_connection_new 
                               (G_IO_STREAM (io_stream), NULL, &error);

   /////////////////////////
   /// error == 0 (TLS support is not available)

I am new to libnice and glib. So, I may be missing something basic.

mateuscb
  • 10,150
  • 3
  • 52
  • 76

1 Answers1

1

Probably need the glib-networking package installed.

TingPing
  • 2,129
  • 1
  • 12
  • 15
  • interesting. So, it would still compile and link but fail at creating a TLS support? I'll give it a try. – mateuscb Oct 19 '15 at 17:27
  • The Tls classes in Gio just rely on a generic interface but it doesn't contain any implementation. glib-networking provides an implementation that depends on external TLS libraries. – TingPing Oct 19 '15 at 21:33
  • that did it. Now I just have to get all the cert and streams going. But got me past my very beginner problem. thanks! – mateuscb Oct 20 '15 at 21:45
  • glib-networking is already the newest version (2.48.2-1~ubuntu16.04.1). I have the above package and still I get the same problem – Ganesh Jun 05 '18 at 08:02