Ssl gstreamer:如何通过TLS进行流式传输?

Ssl gstreamer:如何通过TLS进行流式传输?,ssl,gstreamer,rtsp,Ssl,Gstreamer,Rtsp,在“gst rtsp server/examples/test video.c”中,似乎可以设置TLS证书并启动rtsp服务器。我想知道它在客户端将如何工作,包括例如命令行参数和证书颁发机构等。感谢您的教程 下面是一些尝试后的更多信息,我认为其中最重要的错误是“对等方未能执行TLS握手” 服务器端 $ gst-rtsp-server/examples/test-video 客户端 $ GST_DEBUG=3 gst-launch-1.0 rtspsrc location=rtsps://127

在“gst rtsp server/examples/test video.c”中,似乎可以设置TLS证书并启动rtsp服务器。我想知道它在客户端将如何工作,包括例如命令行参数和证书颁发机构等。感谢您的教程

下面是一些尝试后的更多信息,我认为其中最重要的错误是“对等方未能执行TLS握手”

服务器端

$ gst-rtsp-server/examples/test-video
客户端

$ GST_DEBUG=3 gst-launch-1.0 rtspsrc location=rtsps://127.0.0.1:8554/test protocols=tls ! rtph264depay ! avdec_h264 ! xvimagesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsps://127.0.0.1:8554/test
0:00:00.055578735 12767       0xa51230 ERROR                default gstrtspconnection.c:698:gst_rtsp_connection_connect: failed to connect: Peer failed to perform TLS handshake
0:00:00.055643339 12767       0xa51230 ERROR                rtspsrc gstrtspsrc.c:3677:gst_rtsp_conninfo_connect:<rtspsrc0> Could not connect to server. (Generic error)
0:00:00.055679389 12767       0xa51230 WARN                 rtspsrc gstrtspsrc.c:6148:gst_rtspsrc_retrieve_sdp:<rtspsrc0> error: Failed to connect. (Generic error)
0:00:00.055764506 12767       0xa51230 WARN                 rtspsrc gstrtspsrc.c:6227:gst_rtspsrc_open:<rtspsrc0> can't get sdp
0:00:00.055793412 12767       0xa51230 WARN                 rtspsrc gstrtspsrc.c:4525:gst_rtspsrc_loop:<rtspsrc0> we are not connected
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.
Additional debug info:
gstrtspsrc.c(6148): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Failed to connect. (Generic error)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
$GST\u DEBUG=3 GST-launch-1.0 rtspsrc位置=rtsps://127.0.0.1:8554/test 协议=tls!rtph264depay!avdec_h264!xvimagesink
正在将管道设置为暂停。。。
管道是带电的,不需要预滚。。。
进展:(开放)开放流
进度:(连接)连接到rtsps://127.0.0.1:8554/test
0:00:00.055578735 12767 0xa51230错误默认GSTRTSP连接。c:698:gst\U rtsp\U连接\U连接:连接失败:对等方无法执行TLS握手
0:00:00.055643339 12767 0xa51230错误rtspsrc gstrtspsrc.c:3677:gst\U rtsp\U conninfo\U connect:无法连接到服务器。(一般错误)
0:00:00.055679389 12767 0xa51230警告rtspsrc gstrtspsrc.c:6148:gst\U rtspsrc\U检索\U sdp:错误:连接失败。(一般错误)
0:00:00.055764506 12767 0xa51230警告rtspsrc gstrtspsrc.c:6227:gst\u rtspsrc\u打开:无法获取sdp
0:00:00.055793412 12767 0xa51230警告rtspsrc gstrtspsrc.c:4525:gst_rtspsrc_循环:我们未连接
错误:来自元素/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:无法打开资源进行读写。
其他调试信息:
gstrtspsrc.c(6148):gst_rtspsrc_retrieve_sdp():/GstPipeline:pipeline0/gstrtspsrc:rtspsrc0:
连接失败。(一般错误)
错误:管道不想预卷。
正在将管道设置为暂停。。。
正在将管道设置为就绪。。。
正在将管道设置为空。。。
释放管道。。。

我有同样的问题。尝试使用gstreamer-1.4.3。我收到一条不同的错误消息:
错误默认gstrtspconnection.c:877:gst\u rtsp\u connection\u connection:failed to connect:unceptable TLS certificate
,因此这已经更合理了。啊哈,我想我已经让它工作了。我可以通过传递
TLS验证标志=一般错误
(忽略证书错误)绕过
不可接受的TLS证书
。真正的解决方案可能是通过
tls数据库
,该数据库在我的gstreamer-1.4中可用,但在我的gstreamer-1.2中不可用(有关这些选项,请参阅
gst-inspect-1.0 rtspsrc
)。当然,对于
测试视频
示例,我还必须通过
user id=user-user pw=password
。我必须删除
protocols=tls
,否则我将得到
无法连接到服务器,没有剩下的协议
。这甚至可以在Android上运行:@nh2如果使用tls validation flags=generic error绕过它,我看不到证书的意义。我现在更担心的是,任何拥有用户名和密码但没有证书的人都可以连接到流。如果我遗漏了什么,请告诉我?