dart_vlc
dart_vlc copied to clipboard
TLS error when trying to play a network sample MP4 video
Describe the bug Trying to play network video and player throws TLS client error saying that certificate is not trusted. Is there any way to disable those checks?
Media
Minimal reproducible code
import 'package:dart_vlc/dart_vlc.dart';
import 'package:flutter/material.dart';
void main() async {
await DartVLC.initialize(useFlutterNativeView: true);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Player player = Player(id: 0, registerTexture: false);
@override
void initState() {
player.open(
Playlist(
medias: [
Media.network("https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4"),
Media.network("https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_2mb.mp4")
]
)
);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: NativeVideo(
player: player,
),
),
);
}
}
Flutter logs
[ +34 ms] Build succeeded.
[ +1 ms] 0 Warning(s)
[ ] 0 Error(s)
[ +1 ms] Time Elapsed 00:00:23.81
[ +48 ms] Building Windows application... (completed in 25.3s)
[ +385 ms] Observatory URL on device: http://127.0.0.1:51374/U5tllkTsIBQ=/
[ +6 ms] Caching compiled dill
[ +47 ms] Connecting to service protocol: http://127.0.0.1:51374/U5tllkTsIBQ=/
[ +153 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:51374/U5tllkTsIBQ=/.
[ +113 ms] DDS is listening at http://127.0.0.1:51377/IWB6JJk5i44=/.
[ +82 ms] Successfully connected to service protocol: http://127.0.0.1:51374/U5tllkTsIBQ=/
[ +27 ms] DevFS: Creating new filesystem on the device (null)
[ +27 ms] DevFS: Created new filesystem on the device (file:///C:/Users/rasan/AppData/Local/Temp/windows_player_test69c768e3/windows_player_test/)
[ +3 ms] Updating assets
[ +132 ms] Syncing files to device Windows...
[ +2 ms] <- reset
[ ] Compiling dart to kernel with 0 updated files
[ +1 ms] Processing bundle.
[ +1 ms] <- recompile package:windows_player_test/main.dart 0deb1ac0-8dc0-4e27-9646-7a35b5628bb4
[ ] <- 0deb1ac0-8dc0-4e27-9646-7a35b5628bb4
[ +3 ms] Bundle processing done.
[ +181 ms] Updating files.
[ ] DevFS: Sync finished
[ +2 ms] Syncing files to device Windows... (completed in 193ms)
[ +1 ms] Synced 0.0MB.
[ +3 ms] <- accept
[ +3 ms] Connected to _flutterView/0x277101cb4f0.
[ +4 ms] Flutter run key commands.
[ +3 ms] r Hot reload.
[ +1 ms] R Hot restart.
[ +1 ms] h List all available interactive commands.
[ +1 ms] d Detach (terminate "flutter run" but leave application running).
[ +1 ms] c Clear the screen
[ ] q Quit (terminate the application on the device).
[ ] Running with sound null safety
[ +1 ms] An Observatory debugger and profiler on Windows is available at: http://127.0.0.1:51377/IWB6JJk5i44=/
[ +642 ms] The Flutter DevTools debugger and profiler on Windows is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:51377/IWB6JJk5i44=/
[000001a321c83450] gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate chain uses expired certificate.
[000001a321c83450] main tls client error: TLS session handshake error
[000001a321c83450] main tls client error: connection error: No error
[000001a321c7b190] access stream error: HTTP connection failure
[000001a321c79840] main input error: Your input can't be opened
[000001a321c79840] main input error: VLC is unable to open the MRL 'https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4'. Check the log for details.
[000001a321c83900] gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate chain uses expired certificate.
[000001a321c83900] main tls client error: TLS session handshake error
[000001a321c83900] main tls client error: connection error: No error
[000001a321db0200] access stream error: HTTP connection failure
[000001a321daf8c0] main input error: Your input can't be opened
[√] Flutter (Channel stable, 3.0.3, on Microsoft Windows [Version 10.0.19043.1586], locale en-GB)
• Flutter version 3.0.3 at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 676cefaaff (8 days ago), 2022-06-22 11:34:49 -0700
• Engine revision ffe7b86a1e
• Dart version 2.17.5
• DevTools version 2.12.2
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32616.157
• Windows 10 SDK version 10.0.19041.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[√] VS Code (version 1.68.1)
• VS Code at C:\Users\rasan\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.42.0
[√] Connected device (2 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1586]
• Edge (web) • edge • web-javascript • Microsoft Edge 99.0.1150.39
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 3 categories.
Operating system:
- Platform: Windows
- OS version: 10
Other details: I couldn't paste the whole flutter run output since bug report has a character limit.
- [x] I confirm this is not a bug in the VLC app & only
dart_vlc
. - [ ] I have donated / sponsored
dart_vlc
.
Screenshots If applicable, add screenshots to help explain your problem. Otherwise, do nothing.
I have the same problem. Edit: doesn't work in VLC app either.
@alexmercerind same issue
I have same problem, mp4 links works on vlc app but doesn't work on dart_vlc, I try dart_vlc example app without any changes and still not work.
@alexmercerind, have you stopped supporting this package?
It looks like letsencrypt ssl certificates are broken, but others are working e.g.
https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3
works just fine. Letsencrypt is the most popular CA in the world.
I made a quick attempt to make it work with commandlineArguments: ['--gnutls-dir-trust=$dir'] to a copy of firefox's CA list without luck.
I'm not sure any commandlineArguments are working actually, my test with commandlineArguments: ['--http-user-agent=ArgumentsNotWorking/1.2.3'] fails to change the user agent.
Any news about this error? Is there a workaround? I've encountered the same problem. The certificate is valid but the CA is Let's Encrypt.