Skip to content

Commit d907978

Browse files
committed
(lib)RTMP github workflow (master and fa8646d)
1 parent b4a7b43 commit d907978

1 file changed

Lines changed: 151 additions & 0 deletions

File tree

.github/workflows/rtmp.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: RTMPDump Test
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_gnutls:
17+
name: Build wolfSSL, GnuTLS and provider
18+
timeout-minutes: 20
19+
strategy:
20+
matrix:
21+
os: [ ubuntu-latest ]
22+
rtmpdump_ref: [ 'master', 'fa8646d' ]
23+
fail-fast: false
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- name: Checkout gnutls-wolfssl repository
28+
uses: actions/checkout@v4
29+
30+
- name: Ensure make available (Ubuntu only)
31+
if: matrix.os == 'ubuntu-latest'
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y build-essential
35+
36+
- name: Install GnuTLS dependencies (Ubuntu only)
37+
if: matrix.os == 'ubuntu-latest'
38+
run: |
39+
sudo apt-get install -y gnulib autopoint gperf gtk-doc-tools nettle-dev clang libtasn1-bin libtasn1-6-dev libunistring-dev libp11-kit-dev libunbound-dev
40+
41+
- name: Install RTMPDump dependencies (Ubuntu only)
42+
if: matrix.os == 'ubuntu-latest'
43+
run: |
44+
sudo apt-get install -y zlib1g-dev
45+
46+
- name: Build GnuTLS with wolfSSL provider using setup.sh script
47+
run: |
48+
echo "Running setup.sh..."
49+
BUILD_RESULT=0
50+
GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh
51+
if [ $? -ne 0 ]; then
52+
echo "Build failed"
53+
exit 1
54+
fi
55+
56+
- name: Check setup.sh output directories
57+
run: |
58+
echo "Check for wolfSSL installation..."
59+
if [ ! -d /opt/wolfssl ]; then
60+
echo "/opt/wolfssl not found after setup"
61+
exit 1
62+
fi
63+
echo "Check for GnuTLS installation..."
64+
if [ ! -d /opt/gnutls ]; then
65+
echo "/opt/gnutls not found after setup"
66+
exit 1
67+
fi
68+
echo "Check for wrapper installation..."
69+
if [ ! -d /opt/wolfssl-gnutls-wrapper/lib ]; then
70+
echo "/opt/wolfssl-gnutls-wrapper/lib not found after setup"
71+
exit 1
72+
fi
73+
74+
- name: Build RTMPDump at ${{ matrix.rtmpdump_ref }}
75+
run: |
76+
git clone git://git.ffmpeg.org/rtmpdump
77+
cd rtmpdump
78+
if [ "${{ matrix.rtmpdump_ref }}" != "master" ]; then
79+
git checkout ${{ matrix.rtmpdump_ref }}
80+
fi
81+
82+
- name: Configure and build RTMPDump
83+
working-directory: rtmpdump
84+
run: |
85+
export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig
86+
make SYS=posix CRYPTO=GNUTLS SHARED= \
87+
INC="-I/opt/gnutls/include" \
88+
LDFLAGS="-L/opt/gnutls/lib -Wl,-rpath,/opt/gnutls/lib" \
89+
PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig
90+
91+
- name: Test RTMPDump
92+
working-directory: rtmpdump
93+
run: |
94+
./rtmpdump --help >/dev/null && echo "✅ RTMPDump functional" || exit 1
95+
96+
if ldd ./rtmpdump | grep -v "/opt/gnutls" | grep gnutls; then
97+
echo "❌ Using system GnuTLS"
98+
exit 1
99+
else
100+
echo "✅ Using custom GnuTLS"
101+
fi
102+
103+
echo "Testing TLS handshake with multiple endpoints..."
104+
TLS_SUCCESS=0
105+
106+
# Test Adobe endpoint
107+
echo "Testing Adobe RTMPS endpoint..."
108+
TLS_OUTPUT1=$(timeout 10s ./rtmpdump -r "rtmps://www.adobe.com:443/cfx/st" -V 2>&1 || true)
109+
echo "$TLS_OUTPUT1" | sed 's/ wgw \[/\nwgw [/g'
110+
if echo "$TLS_OUTPUT1" | grep -q "connected, handshaking"; then
111+
echo "✅ Adobe TLS handshake successful"
112+
TLS_SUCCESS=1
113+
else
114+
echo "❌ Adobe TLS handshake failed"
115+
fi
116+
117+
# Test Twitch endpoint
118+
echo "Testing Twitch RTMPS endpoint..."
119+
TLS_OUTPUT2=$(timeout 10s ./rtmpdump -r "rtmps://live.twitch.tv:443/live/test" -V 2>&1 || true)
120+
echo "$TLS_OUTPUT2" | sed 's/ wgw \[/\nwgw [/g'
121+
if echo "$TLS_OUTPUT2" | grep -q "connected, handshaking"; then
122+
echo "✅ Twitch TLS handshake successful"
123+
TLS_SUCCESS=1
124+
else
125+
echo "❌ Twitch TLS handshake failed"
126+
fi
127+
128+
# Test YouTube endpoint
129+
echo "Testing YouTube RTMPS endpoint..."
130+
TLS_OUTPUT3=$(timeout 10s ./rtmpdump -r "rtmps://a.rtmp.youtube.com:443/live2/test" -V 2>&1 || true)
131+
echo "$TLS_OUTPUT3" | sed 's/ wgw \[/\nwgw [/g'
132+
if echo "$TLS_OUTPUT3" | grep -q "connected, handshaking"; then
133+
echo "✅ YouTube TLS handshake successful"
134+
TLS_SUCCESS=1
135+
else
136+
echo "❌ YouTube TLS handshake failed"
137+
fi
138+
139+
# Overall TLS validation result
140+
if [ $TLS_SUCCESS -eq 1 ]; then
141+
echo "✅ TLS validation passed - at least one endpoint connected successfully"
142+
else
143+
echo "❌ TLS validation failed - no endpoints connected"
144+
echo "Adobe output: $TLS_OUTPUT1"
145+
echo "Twitch output: $TLS_OUTPUT2"
146+
echo "YouTube output: $TLS_OUTPUT3"
147+
exit 1
148+
fi
149+
150+
# Note that RTMP handshake failures are expected
151+
echo "ℹ️ RTMP handshake failures are expected (missing credentials/auth)"

0 commit comments

Comments
 (0)