I am receiving the dtls error with GStreamer `/Gst...
# ingress
n
I am receiving the dtls error with GStreamer
Copy code
/GstPipeline:pipeline0/GstLiveKitWebRTCSrc:src/GstBin:bin0/GstWebRTCBin:webrtcbin0/TransportReceiveBin:transportreceivebin0/GstDtlsSrtpDec:dtlssrtpdec0/GstDtlsDec:dtlsdec0:
Fatal SSL error
started from yesterday, any ideas?
Copy code
Nest] 1  - 08/20/2025, 2:59:15 AM     LOG [MONITOR_LMVMTPE007337_02-52-05] Room LMVMTPE007337 track published
[Nest] 630  - 08/20/2025, 2:59:16 AM   ERROR [RC_LMVMTPE007337_2025-08-20-02-59-15] Error: Could not read from resource.
[Nest] 630  - 08/20/2025, 2:59:16 AM   ERROR [RC_LMVMTPE007337_2025-08-20-02-59-15] Debug information: ../ext/dtls/gstdtlsdec.c(504): process_buffer (): /GstPipeline:pipeline0/GstLiveKitWebRTCSrc:src/GstBin:bin0/GstWebRTCBin:webrtcbin0/TransportReceiveBin:transportreceivebin0/GstDtlsSrtpDec:dtlssrtpdec0/GstDtlsDec:dtlsdec0:
Fatal SSL error
We got more detail logs 00000.800169969 115 0x7fffd0001e30 FIXME default gstutils.c4088gst_element_decorate_stream_id_internal:<nicesrc0> Creating random stream-id, consider implementing a deterministic way of creating a stream-id 00000.800201469 115 0x7fffd0001e30 WARN GST_PADS gstpad.c4392gst_pad_peer_query&lt;nicesrc0src> could not send sticky events 00000.805383026 115 0x7fffb412e5b0 ERROR webrtcbin gstwebrtcbin.c7153gst_webrtc_bin_get_transceiver:<webrtcbin0> No transceiver for idx 0 00000.805632237 115 0x7fffb412e5b0 WARN webrtcsrc net/webrtc/src/webrtcsrc/imp.rs854gstrswebrtc:webrtcsrc👿Sessionremote description set{{closure}} Transceiver for idx 0 does not exist, GStreamer <= 1.24, adding it ourself 00000.809583655 115 0x7fffb412e5b0 ERROR webrtcbin gstwebrtcbin.c7153gst_webrtc_bin_get_transceiver:<webrtcbin0> No transceiver for idx 1 00000.809622655 115 0x7fffb412e5b0 WARN webrtcsrc net/webrtc/src/webrtcsrc/imp.rs854gstrswebrtc:webrtcsrc👿Sessionremote description set{{closure}} Transceiver for idx 1 does not exist, GStreamer <= 1.24, adding it ourself 00001.825881218 115 0x7fffd0002790 FIXME default gstutils.c4088gst_element_decorate_stream_id_internal:<dtlsenc0> Creating random stream-id, consider implementing a deterministic way of creating a stream-id 00001.921580589 115 0x7fffd0002150 ERROR dtlsconnection gstdtlsconnection.c994handle_error:<dtlsconnection0> Fatal SSL error 00001.922628892 115 0x7fffd0002150 ERROR dtlsconnection gstdtlsconnection.c977ssl_err_cb:<dtlsconnection0> ssl error: C0C63FBDFF7F0000error0A000152:SSL routinesfinal renegotiateunsafe legacy renegotiation disabled../deps/openssl/openssl/ssl/statem/extensions.c921:
Currently we are using livekit/gstreamer 1.24.5-prod as base image and it's using ubuntu 24 and it's related openssl is version 3.*, and looks like livekit server is responding legacy ssl back.
r
Sorry, I don't really have much knowledge of gstreamer. We have a KB article that has a few of the key words from your message. Maybe it can help? https://kb.livekit.io/articles/1724892785-establishing-media-connection-firewall-troubleshooting I asked our internal LLM and got this. Maybe it will help? The
Fatal SSL error
you are encountering with GStreamer is likely related to the OpenSSL configuration. The error message indicates that "unsafe legacy renegotiation" is disabled, which is a security feature in OpenSSL 3.x. This means that your GStreamer pipeline is attempting to use a legacy SSL renegotiation method that is no longer permitted by default in OpenSSL 3.x. Here are a few steps you can take to troubleshoot and potentially resolve the issue: 1. Check OpenSSL Configuration: Ensure that your OpenSSL configuration allows for legacy renegotiation if you need to support older clients. You can do this by modifying the OpenSSL configuration file (usually
openssl.cnf
) to enable legacy renegotiation. However, be cautious as this can introduce security vulnerabilities. 2. Upgrade GStreamer: If possible, consider upgrading to a newer version of GStreamer that may have better compatibility with OpenSSL 3.x. The logs indicate that you are using
livekit/gstreamer 1.24.5-prod
, which may have compatibility issues with the current OpenSSL version. 3. Use a Different Base Image: If the legacy support is necessary, you might want to switch to a base image that uses an older version of OpenSSL (e.g., OpenSSL 1.1.x) where legacy renegotiation is still supported. 4. Review GStreamer Pipeline: Ensure that your GStreamer pipeline is correctly configured to handle DTLS connections. The warnings about missing transceivers and the creation of random stream IDs may indicate that the pipeline is not set up correctly. 5. Consult Documentation: Review the GStreamer and LiveKit documentation for any specific configurations or flags that may need to be set for DTLS connections. 6. Log Analysis: The additional logs you provided indicate issues with transceivers and stream IDs. Make sure that your GStreamer setup is correctly managing these elements, as they are crucial for establishing a successful WebRTC connection. 7. If you continue to experience issues, consider reaching out to the LiveKit community or support channels for more tailored assistance. Notes: • The error is specifically tied to the use of OpenSSL 3.x and its handling of legacy SSL renegotiation. • Ensure that your GStreamer setup is compatible with the version of OpenSSL you are using. • The warnings about transceivers may also need to be addressed to ensure proper WebRTC functionality.
n
We have already tried above suggestion. We found out that even though livekit/gstreamer 1.24.5 is using ubuntu 24 which native openssl is 3.*. But the gstreamer is still using 1.1.1, by overwriting openssl config config to unsafe method can allow to connect, but we have another library node gst is not allowed to take overwritten ssl params. We are still trying to the following approach, and it's quite suffering 1. Create own use base image and rebuild all the dependency from scratch... 2. livekit/gstreamer 1.26.2-* are missing some dependency, we are going to try gameonwhales/gstreamer:1.26.2 to see if the Gstreamer inside can use openssl 3
We have find one work around to fix dtls issue, and using gst 1.26 to avoid comprehensive config overwrite. And we also investigating pure ubuntu base image solution started from scratch, but this approach is hard.
Copy code
FROM gameonwhales/gstreamer:1.26.2 AS base

# 安裝必要的套件和依賴
RUN apt update && apt install -y \
    curl \
    wget \
    # GStreamer 相關套件
    libicu-dev \
    libnice10 \
    libnice-dev \
    libgirepository1.0-dev \
    gir1.2-gstreamer-1.0 \
    gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-ugly \
    gstreamer1.0-libav \
    gstreamer1.0-nice \
    gstreamer1.0-tools \
    # SSL/CA 證書(GStreamer 1.26 需要較少的 SSL 配置)
    ca-certificates \
    openssl \
    # 網路診斷工具
    net-tools \
    iputils-ping \
    && rm -rf /var/lib/apt/lists/*

# 更新證書
RUN update-ca-certificates

# 下載 LiveKit WebRTC plugin - 使用更新的版本和改進的下載方法
RUN echo "Downloading LiveKit WebRTC plugin for GStreamer 1.26..." && \
    PLUGIN_PATH="/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstrswebrtc.so" && \
    # 嘗試最新版本 (0.14.1)
    (curl -L --http1.1 --connect-timeout 30 --max-time 600 --retry 3 --retry-delay 5 \
        -H "User-Agent: Mozilla/5.0" \
        -o "$PLUGIN_PATH" \
        "https://github.com/BeeInventor/gst-plugins-rs/releases/download/0.14.1/libgstrswebrtc.so" && \
     echo "Downloaded plugin version 0.14.1") || \
    # 備用版本
    (curl -L --http1.1 --connect-timeout 30 --max-time 600 --retry 3 --retry-delay 5 \
        -H "User-Agent: Mozilla/5.0" \
        -o "$PLUGIN_PATH" \
        "https://github.com/BeeInventor/gst-plugins-rs/releases/download/0.14.0-alpha.1-a8146f33/libgstrswebrtc.so" && \
     echo "Downloaded backup plugin version") || \
    (echo "Plugin download failed" && exit 1) && \
    # 設置權限並驗證
    chmod +x "$PLUGIN_PATH" && \
    ls -la "$PLUGIN_PATH" && \
    echo "Plugin installation completed"

# 安裝 Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt install -y nodejs && \
    npm install -g corepack@latest && \
    corepack enable && \
    corepack prepare pnpm --activate

# 驗證 GStreamer 1.26 安裝
RUN echo "=== GStreamer 1.26 Verification ===" && \
    gst-launch-1.0 --version && \
    echo "=== Available WebRTC Plugins ===" && \
    gst-inspect-1.0 | grep -E "(webrtc|livekit|nice)" && \
    echo "=== Plugin Path Contents ===" && \
    ls -la /usr/lib/x86_64-linux-gnu/gstreamer-1.0/ | grep -E "(webrtc|livekit|nice)"

WORKDIR /app

FROM base AS pnpm-fetch
COPY package.json pnpm-lock.yaml ./
RUN pnpm fetch

FROM pnpm-fetch AS prod-deps
# 修正重複的 --ignore-scripts
RUN pnpm install --offline --ignore-scripts --prod

FROM pnpm-fetch AS build
# 修正重複的 --ignore-scripts
RUN pnpm install --offline --ignore-scripts
COPY . ./
RUN pnpm exec nest build

FROM base AS app

# 複製依賴和建構檔案
COPY --from=prod-deps /app/node_modules ./node_modules/
COPY --from=build /app/dist ./dist/
COPY .env* ./

# 設置 GStreamer 1.26 環境變數
ENV GST_PLUGIN_PATH="/usr/lib/x86_64-linux-gnu/gstreamer-1.0"
ENV GST_PLUGIN_SCANNER="/usr/lib/x86_64-linux-gnu/gstreamer-1.0/gst-plugin-scanner"
ENV GST_REGISTRY="/tmp/gst-registry.bin"

# GStreamer 1.26 的簡化環境變數設置(不需要複雜的 DTLS 配置)
ENV GST_DEBUG="3"
ENV GST_DEBUG_FILE="/tmp/gstreamer-debug.log"

# 基本的 SSL 設置(GStreamer 1.26 內建更好的 DTLS 支援)
ENV SSL_CERT_DIR="/etc/ssl/certs"
ENV SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"

# 建立日誌目錄
RUN mkdir -p /tmp/logs && chmod 777 /tmp/logs

# 最終驗證 GStreamer 設置
RUN echo "=== Final GStreamer 1.26 Verification ===" && \
    gst-launch-1.0 --version && \
    echo "" && \
    echo "=== LiveKit Plugin Check ===" && \
    (gst-inspect-1.0 livekitwebrtcsrc > /dev/null 2>&1 && \
     echo "✓ livekitwebrtcsrc plugin is ready") || \
    (echo "⚠ livekitwebrtcsrc plugin verification failed" && \
     echo "Available plugins:" && \
     gst-inspect-1.0 | grep -E "(webrtc|livekit)" | head -10) && \
    echo "" && \
    echo "=== WebRTC Capabilities ===" && \
    gst-inspect-1.0 | grep -E "(webrtc|dtls|nice|srtp)" | head -5

CMD ["node", "dist/main"]
Hello @refined-appointment-81829, In reference to the DTLS issue, I have created a minimal reproduction case. Testing with livekit/gstreamer images ranging from 1.24.5-prod to 1.24.12-prod yields the same outcome. Have there been any changes in the last two months that could influence this behavior? Thank you https://github.com/libterty/livekit-record-issue