[FFmpeg-trac] #7801(avformat:new): facebook https connection fails using ffmpeg with gnu-tls

FFmpeg trac at avcodec.org
Tue Mar 19 13:19:51 EET 2019


#7801: facebook https connection fails using ffmpeg with gnu-tls
------------------------------------+--------------------------------------
             Reporter:  remitamine  |                     Type:  defect
               Status:  new         |                 Priority:  normal
            Component:  avformat    |                  Version:  git-master
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+--------------------------------------
 Summary of the bug:
 https connection to Facebook servers fails with FFmpeg(using gnu-tls)
 while it works with FFmpeg(using openssl), VLC(uses gnu-tls), curl(uses
 openssl), gnutls-cli.
 I can attach Wireshark capture files if needed to the facebook server
 using any configuration with the mentioned tools.
 Use case:
 watching facebook video using mpv(with youtube-dl integration) with
 ArchLinux FFmpeg package(based on gnu-tls).
 How to reproduce:
 log using gnu-tls:
 {{{
 ./ffmpeg -v 9 -loglevel 99 -i  $(curl
 'https://www.facebook.com/Google/videos/vb.104958162837/407275083345153/'
 | grep -Po '[hs]d_src(?:_no_ratelimit)?\s*:\s*"\K[^"]+')
   % Total    % Received % Xferd  Average Speed   Time    Time     Time
 Current
                                  Dload  Upload   Total   Spent    Left
 Speed
 100  675k    0  675k    0     0   411k      0 --:--:--  0:00:01 --:--:--
 411k
 ffmpeg version N-93397-gf8075b2c91 Copyright (c) 2000-2019 the FFmpeg
 developers
   built with gcc 8.2.1 (GCC) 20181127
   configuration: --enable-gnutls
   libavutil      56. 26.100 / 56. 26.100
   libavcodec     58. 47.103 / 58. 47.103
   libavformat    58. 26.101 / 58. 26.101
   libavdevice    58.  6.101 / 58.  6.101
   libavfilter     7. 48.100 /  7. 48.100
   libswscale      5.  4.100 /  5.  4.100
   libswresample   3.  4.100 /  3.  4.100
 Splitting the commandline.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument '9'.
 Reading option '-loglevel' ... matched as option 'loglevel' (set logging
 level) with argument '99'.
 Reading option '-i' ... matched as input url with argument 'https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=8f24eeb02330f314e494359779f89932&oe=5C90D13B'.
 Reading option 'https://scontent-
 mrs1-1.xx.fbcdn.net/v/t66.18014-6/43003158_364041164414690_2702344452620066439_n.mp4?_nc_cat=110&efg=eyJxZV9ncm91cHMiOlsidW5tdXRlZCJdLCJ2ZW5jb2RlX3RhZyI6Im9lcF9oZCJ9&_nc_ht
 =scontent-mrs1-1.xx&oh=5ada44e9de42d1a5a1688194e54cd036&oe=5D1A66A2' ...
 matched as output url.
 Reading option 'https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJybHIiOjU5OSwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIn0%3D&rl=599&vabr=333&_nc_ht
 =video-mrs1-1.xx&oh=8f24eeb02330f314e494359779f89932&oe=5C90D13B' ...
 matched as output url.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument 9.
 Successfully parsed a group of options.
 Parsing a group of options: input url https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=8f24eeb02330f314e494359779f89932&oe=5C90D13B.
 Successfully parsed a group of options.
 Opening an input file: https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=8f24eeb02330f314e494359779f89932&oe=5C90D13B.
 [NULL @ 0x561ba41412c0] Opening 'https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=8f24eeb02330f314e494359779f89932&oe=5C90D13B' for
 reading
 [https @ 0x561ba4141e00] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 [tcp @ 0x561ba4144440] Original list of addresses:
 [tcp @ 0x561ba4144440] Address 31.13.75.14 port 443
 [tcp @ 0x561ba4144440] Address 2a03:2880:f009:13:face:b00c:0:1823 port 443
 [tcp @ 0x561ba4144440] Interleaved list of addresses:
 [tcp @ 0x561ba4144440] Address 31.13.75.14 port 443
 [tcp @ 0x561ba4144440] Address 2a03:2880:f009:13:face:b00c:0:1823 port 443
 [tcp @ 0x561ba4144440] Starting connection attempt to 31.13.75.14 port 443
 [tcp @ 0x561ba4144440] Successfully connected to 31.13.75.14 port 443
 https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=8f24eeb02330f314e494359779f89932&oe=5C90D13B: Resource
 temporarily unavailable
 }}}
 log using openssl:
 {{{
 ./ffmpeg -v 9 -loglevel 99 -i  $(curl
 'https://www.facebook.com/Google/videos/vb.104958162837/407275083345153/'
 | grep -Po '[hs]d_src(?:_no_ratelimit)?\s*:\s*"\K[^"]+')
   % Total    % Received % Xferd  Average Speed   Time    Time     Time
 Current
                                  Dload  Upload   Total   Spent    Left
 Speed
 100  675k    0  675k    0     0   452k      0 --:--:--  0:00:01 --:--:--
 452k
 ffmpeg version N-93397-gf8075b2c91 Copyright (c) 2000-2019 the FFmpeg
 developers
   built with gcc 8.2.1 (GCC) 20181127
   configuration: --enable-openssl
   libavutil      56. 26.100 / 56. 26.100
   libavcodec     58. 47.103 / 58. 47.103
   libavformat    58. 26.101 / 58. 26.101
   libavdevice    58.  6.101 / 58.  6.101
   libavfilter     7. 48.100 /  7. 48.100
   libswscale      5.  4.100 /  5.  4.100
   libswresample   3.  4.100 /  3.  4.100
 Splitting the commandline.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument '9'.
 Reading option '-loglevel' ... matched as option 'loglevel' (set logging
 level) with argument '99'.
 Reading option '-i' ... matched as input url with argument 'https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=c537a387fbc372d40ecb3d9148ed0dd7&oe=5C90FB6B'.
 Reading option 'https://scontent-
 mrs1-1.xx.fbcdn.net/v/t66.18014-6/43003158_364041164414690_2702344452620066439_n.mp4?_nc_cat=110&efg=eyJxZV9ncm91cHMiOlsidW5tdXRlZCJdLCJ2ZW5jb2RlX3RhZyI6Im9lcF9oZCJ9&_nc_ht
 =scontent-mrs1-1.xx&oh=5ada44e9de42d1a5a1688194e54cd036&oe=5D1A66A2' ...
 matched as output url.
 Reading option 'https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJybHIiOjU5OSwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIn0%3D&rl=599&vabr=333&_nc_ht
 =video-mrs1-1.xx&oh=c537a387fbc372d40ecb3d9148ed0dd7&oe=5C90FB6B' ...
 matched as output url.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument 9.
 Successfully parsed a group of options.
 Parsing a group of options: input url https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=c537a387fbc372d40ecb3d9148ed0dd7&oe=5C90FB6B.
 Successfully parsed a group of options.
 Opening an input file: https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=c537a387fbc372d40ecb3d9148ed0dd7&oe=5C90FB6B.
 [NULL @ 0x560c760b57c0] Opening 'https://video-
 mrs1-1.xx.fbcdn.net/v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=c537a387fbc372d40ecb3d9148ed0dd7&oe=5C90FB6B' for
 reading
 [https @ 0x560c760b6400] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 [tcp @ 0x560c760b8900] Original list of addresses:
 [tcp @ 0x560c760b8900] Address 31.13.75.14 port 443
 [tcp @ 0x560c760b8900] Address 2a03:2880:f009:13:face:b00c:0:1823 port 443
 [tcp @ 0x560c760b8900] Interleaved list of addresses:
 [tcp @ 0x560c760b8900] Address 31.13.75.14 port 443
 [tcp @ 0x560c760b8900] Address 2a03:2880:f009:13:face:b00c:0:1823 port 443
 [tcp @ 0x560c760b8900] Starting connection attempt to 31.13.75.14 port 443
 [tcp @ 0x560c760b8900] Successfully connected to 31.13.75.14 port 443
 [https @ 0x560c760b6400] request: GET
 /v/t42.9040-2/50903487_364791754308581_3636070504785248256_n.mp4?_nc_cat=100&efg=eyJ2ZW5jb2RlX3RhZyI6InN2ZV9zZCJ9&_nc_ht
 =video-mrs1-1.xx&oh=c537a387fbc372d40ecb3d9148ed0dd7&oe=5C90FB6B HTTP/1.1
 ...
 }}}
 log from VLC 3.0.6.
 {{{
 [00007f83240014e0] main tls client debug: looking for tls client module
 matching "any": 1 candidates
 ...
 [00007f83240014e0] gnutls tls client debug: using GnuTLS version 3.6.6
 ...
 [00007f83240014e0] gnutls tls client debug: loaded 154 trusted CAs from
 system
 [00007f83240014e0] main tls client debug: using tls client module "gnutls"
 [00007f83240014e0] main tls client debug: resolving video-
 mrs1-1.xx.fbcdn.net ...
 [00007f83240014e0] gnutls tls client debug: TLS handshake: Resource
 temporarily unavailable, try again.
 [00007f83240014e0] gnutls tls client debug: TLS handshake: Resource
 temporarily unavailable, try again.
 [00007f83240014e0] gnutls tls client debug: TLS handshake: Resource
 temporarily unavailable, try again.
 [00007f83240014e0] gnutls tls client debug: TLS handshake: Resource
 temporarily unavailable, try again.
 [00007f83240014e0] gnutls tls client debug: TLS handshake: Success.
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7801>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list