[Live-devel] openRTSP crash when receiving stream via https

Gajdosik Johannes j.gajdosik at pke.at
Tue Nov 29 06:06:59 PST 2022


I use version live.2022.11.19.tar.gz. Compiled using config.linux-gdb (with -O0 for better debugging)



On the server side I call



rtspServer->setTLSState(PATHNAME_TO_CERTIFICATE_FILE,PATHNAME_TO_PRIVATE_KEY_FILE,False,False);

like in testOnDemandRTSPServer.cpp.

Last 2 parameters False,False because i do not need rtsps/srtp, but https tunnelling.

The Server works, I can receive video with some other software made by a colleague long ago..





On the Client side I call in gdb:



  openRTSP -T 8880 rtsps://localhost:5554/h265



in order to receive the stream via http over TLS.





gdb ./openRTSP

GNU gdb (Gentoo 8.3.1 vanilla) 8.3.1

Copyright (C) 2019 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Type "show copying" and "show warranty" for details.

This GDB was configured as "x86_64-pc-linux-gnu".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:

<https://bugs.gentoo.org/>.

Find the GDB manual and other documentation resources online at:

    <http://www.gnu.org/software/gdb/documentation/>.



For help, type "help".

Type "apropos word" to search for commands related to "word"...

Reading symbols from ./openRTSP...

(gdb) r -T 8880 rtsps://localhost:5554/h265 Starting program: /sdb3/JohannesGajdosikPKE/live.2022.11.19/testProgs/openRTSP -T 8880 rtsps://localhost:5554/h265 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1".

Created new TCP socket 3 for connection

Connecting to 127.0.0.1, port 8880 on socket 3...

...TLS connection completed

...remote connection opened

Requesting RTSP-over-HTTP tunneling (on port 8880)



Sending request: GET /h265 HTTP/1.0

CSeq: 1

User-Agent: /sdb3/JohannesGajdosikPKE/live.2022.11.19/testProgs/openRTSP (LIVE555 Streaming Media v2022.11.19)

Host: 127.0.0.1

x-sessioncookie: 0ce20afb86b64c33db92c3c

Accept: application/x-rtsp-tunnelled

Pragma: no-cache

Cache-Control: no-cache





Received 143 new bytes of response data.

Received a complete GET response:

HTTP/1.0 200 OK

Date: Tue, Nov 29 2022 12:43:23 GMT

Cache-Control: no-cache

Pragma: no-cache

Content-Type: application/x-rtsp-tunnelled





Connecting to 127.0.0.1, port 8880 on socket 4...

Sending request: POST /h265 HTTP/1.0

CSeq: 1

User-Agent: /sdb3/JohannesGajdosikPKE/live.2022.11.19/testProgs/openRTSP (LIVE555 Streaming Media v2022.11.19)

Host: 127.0.0.1

x-sessioncookie: 0ce20afb86b64c33db92c3c

Content-Type: application/x-rtsp-tunnelled

Pragma: no-cache

Cache-Control: no-cache

Content-Length: 32767

Expires: Sun, 9 Jan 1972 00:00:00 GMT





Program received signal SIGSEGV, Segmentation fault.

0x00007ffff7f3380c in ssl_write_internal () from /usr/lib64/libssl.so.1.1

(gdb) bt

#0  0x00007ffff7f3380c in ssl_write_internal () from /usr/lib64/libssl.so.1.1

#1  0x00007ffff7f339a3 in SSL_write () from /usr/lib64/libssl.so.1.1

#2  0x000055555559cb9f in TLSState::write (this=0x55555562d958,

    data=0x55555566ae40 "POST /h265 HTTP/1.0\r\nCSeq: 1\r\nUser-Agent: /sdb3/JohannesGajdosikPKE/live.2022.11.19/testProgs/openRTSP (LIVE555 Streaming Media v2022.11.19)\r\nHost: 127.0.0.1\r\nx-sessioncookie: 0ce20afb86b64c33db92c3c\r"..., count=352) at TLSState.cpp:45

#3  0x0000555555589010 in RTSPClient::write (this=0x55555562d760,

    data=0x55555566ae40 "POST /h265 HTTP/1.0\r\nCSeq: 1\r\nUser-Agent: /sdb3/JohannesGajdosikPKE/live.2022.11.19/testProgs/openRTSP (LIVE555 Streaming Media v2022.11.19)\r\nHost: 127.0.0.1\r\nx-sessioncookie: 0ce20afb86b64c33db92c3c\r"..., count=352) at RTSPClient.cpp:2023

#4  0x000055555558330c in RTSPClient::sendRequest (this=0x55555562d760, request=0x555555658a40) at RTSPClient.cpp:581

#5  0x000055555558740c in RTSPClient::setupHTTPTunneling2 (this=0x55555562d760) at RTSPClient.cpp:1610

#6  0x000055555558760f in RTSPClient::connectionHandler1 (this=0x55555562d760) at RTSPClient.cpp:1642

#7  0x0000555555587459 in RTSPClient::connectionHandler (instance=0x55555562d760) at RTSPClient.cpp:1615

#8  0x00005555555e1a40 in BasicTaskScheduler::SingleStep (this=0x55555562ceb0, maxDelayTime=0) at BasicTaskScheduler.cpp:171

#9  0x00005555555e4184 in BasicTaskScheduler0::doEventLoop (this=0x55555562ceb0, watchVariable=0x0) at BasicTaskScheduler0.cpp:80

#10 0x000055555556e10c in main (argc=2, argv=0x7fffffffdfc8) at playCommon.cpp:654

(gdb) f 2

#2  0x000055555559cb9f in TLSState::write (this=0x55555562d958,

    data=0x55555566ae40 "POST /h265 HTTP/1.0\r\nCSeq: 1\r\nUser-Agent: /sdb3/JohannesGajdosikPKE/live.2022.11.19/testProgs/openRTSP (LIVE555 Streaming Media v2022.11.19)\r\nHost: 127.0.0.1\r\nx-sessioncookie: 0ce20afb86b64c33db92c3c\r"..., count=352) at TLSState.cpp:45

45        return SSL_write(fCon, data, count);

(gdb) p fCon

$1 = (SSL *) 0x0

(gdb) p *this

$2 = {_vptr.TLSState = 0x55555560c620 <vtable for ClientTLSState+16>, isNeeded = 1 '\001', fHasBeenSetup = 0 '\000', fCtx = 0x0, fCon = 0x0}





the crash is quite obvious: The TLSState is not initialized and fCon==nullptr.





On the other hand, when calling

  rtspServer->setTLSState(PATHNAME_TO_CERTIFICATE_FILE,PATHNAME_TO_PRIVATE_KEY_FILE,True);

on the server side, I can receive the stream vi RTSPS/SRTP by calling "openRTSP rtsps://localhost:5554/h265".

Which is good in itself, but I want https.



Maybe I have called openRTSP in a wrong way, please help!

Yours, Johannes





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20221129/2f411084/attachment.htm>


More information about the live-devel mailing list