Search code examples
androidcandroid-ndkgstreamerrtsp

Getting "Unacceptable TLS cerificate" error in Android when using Gstreamer


I currently have my project set up with GStreamer and I want to stream a RTSP link. Before I integrated GStreamer with my project I went over the tutorials as mentioned [here][1] and tested the media uri with my own rtsp link. It worked! But it fails to work on my project. Is there anything I should be looking for?

-Project is pointed at the most updated gstreamer library

-Project is also pointing at the most pointed ndk build

-C code runs well and fine since I'm able to see the logs provided.

Full log and error provided below:

2020-11-11 15:54:25.186 4248-4248/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.785514844 0x789bdded60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:369:check_initialization_complete Initialization complete, notifying application. native_window:0x791bd7b4a0 main_loop:0x77abda46f0
2020-11-11 15:54:25.187 4248-4248/com.name.app.debug E/GStreamer: GStreamer initialized:
2020-11-11 15:54:25.187 4248-4248/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.785556094 0x789bdded60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:515:gst_native_set_uri Setting URI to rtsp://censored
2020-11-11 15:54:25.187 4248-4248/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.785683907 0x789bdded60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:566:gst_native_set_position Scheduling seek to 0:00:00.000000000 for later
2020-11-11 15:54:25.187 4248-4248/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.785701719 0x789bdded60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:533:gst_native_play Setting state to PLAYING
2020-11-11 15:54:25.188 4248-4248/com.name.app.debug I/GStreamer:   playing:
2020-11-11 15:54:25.188 4248-4726/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.786643073 0x789be89f60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:115:set_ui_message Setting message to: State changed to PAUSED
2020-11-11 15:54:25.188 4248-4726/com.name.app.debug E/gStreamer: Setting up message...State changed to PAUSED
2020-11-11 15:54:25.188 4248-4726/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.786874219 0x789be89f60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:209:execute_seek Seeking to 0:00:00.000000000
2020-11-11 15:54:25.197 4248-4726/com.name.app.debug W/GStreamer+tutorial-5: 0:06:35.795876512 0x789be89f60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:155:refresh_ui Could not query current duration (normal for still pictures)
2020-11-11 15:54:25.197 4248-4726/com.name.app.debug W/GStreamer+tutorial-5: 0:06:35.795964585 0x789be89f60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:162:refresh_ui Could not query current position (normal for still pictures)
2020-11-11 15:54:25.227 4248-4747/com.name.app.debug E/GStreamer+default: 0:06:35.826470421 0x78bbdb14a0 ../gst-libs/gst/rtsp/gstrtspconnection.c:1052:gst_rtsp_connection_connect_with_response_usec failed to connect: Unacceptable TLS certificate
2020-11-11 15:54:25.227 4248-4747/com.name.app.debug E/GStreamer+rtspsrc: 0:06:35.826515473 0x78bbdb14a0 ../gst/rtsp/gstrtspsrc.c:5137:gst_rtsp_conninfo_connect:<source> Could not connect to server. (Generic error)
2020-11-11 15:54:25.228 4248-4747/com.name.app.debug W/GStreamer+rtspsrc: 0:06:35.826535682 0x78bbdb14a0 ../gst/rtsp/gstrtspsrc.c:7999:gst_rtspsrc_retrieve_sdp:<source> error: Failed to connect. (Generic error)
2020-11-11 15:54:25.228 4248-4747/com.name.app.debug W/GStreamer+rtspsrc: 0:06:35.826635786 0x78bbdb14a0 ../gst/rtsp/gstrtspsrc.c:8084:gst_rtspsrc_open:<source> can't get sdp
2020-11-11 15:54:25.228 4248-4747/com.name.app.debug W/GStreamer+rtspsrc: 0:06:35.826670109 0x78bbdb14a0 ../gst/rtsp/gstrtspsrc.c:8745:gst_rtspsrc_play:<source> failed to open stream
2020-11-11 15:54:25.228 4248-4747/com.name.app.debug W/GStreamer+rtspsrc: 0:06:35.826690317 0x78bbdb14a0 ../gst/rtsp/gstrtspsrc.c:6116:gst_rtspsrc_loop:<source> we are not connected
2020-11-11 15:54:25.228 4248-4726/com.name.app.debug D/GStreamer+tutorial-5: 0:06:35.826741932 0x789be89f60 C:/Users/path/project-name/app/src/main/jni/tutorial-5.c:115:set_ui_message Setting message to: Error received from element source: Could not open resource for reading and writing.


  [1]: https://gstreamer.freedesktop.org/documentation/tutorials/android/index.html?gi-language=c

Solution

  • Found the answer! Apparently I had my ssl certs folder in the wrong assets directory folder src/assets/ssl/certs/ca-certificates.crt And it was supposed to be in the src/main/assets folder. Stupid mistake, but I hope this helps other people out!