本文介绍了“不支持TLS"用libnice创建GTlsClientConnection时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有工作代码,其中两个对等点通过中继服务器(coturn)进行连接,而在伪tcp上一切似乎都很好.我已经使用 nice_agent_attach_recv() nice_agent_get_io_stream()成功地测试了消息交换.

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().

但是当我尝试创建 GTlsClientConnection 时,我又回来了: 0:TLS支持不可用

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

这是一些部分代码:

   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)

我是libnice和glib的新手.因此,我可能缺少一些基本知识.

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

推荐答案

可能需要安装 glib-networking 软件包.

这篇关于“不支持TLS"用libnice创建GTlsClientConnection时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-13 23:24