Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player fails if certificate error #639

Open
Z6P0 opened this issue Sep 29, 2020 · 8 comments
Open

Player fails if certificate error #639

Z6P0 opened this issue Sep 29, 2020 · 8 comments
Labels
bug platform-android Affects the android platform reproducible Bug can be reproduced

Comments

@Z6P0
Copy link

Z6P0 commented Sep 29, 2020

I try to play MP3 files from a server (not mine) with an invalid certificate. It plays in other players and browsers, but it fails with audioplayers package.

Check for example the URL "https://streaming-canal-u.fmsh.fr/vod/media/canalu/videos/iap/r.sultats.de.la.mission.juno_55111/philippezarka.mp3".

wget says:
ERROR: cannot verify streaming-canal-u.fmsh.fr's certificate, issued by 'CN=TERENA SSL CA 3,O=TERENA,L=Amsterdam,ST=Noord-Holland,C=NL':
Unable to locally verify the issuer's authority.

I tried to bypass the certificate check with HttpOverrides as documented here but it didn't work:
flutter/flutter#19588 (comment)

It fails with this uninformative error:
onPlayerError MediaPlayer error with what:MEDIA_ERROR_UNKNOWN {what:1} extra:MEDIA_ERROR_SYSTEM

Platform: Android 10

@Z6P0 Z6P0 added the bug label Sep 29, 2020
@sathishmscict
Copy link

Same issue here :
W/MediaHTTPConnection(18260): request failed with error => 0
D/MediaHTTPConnection(18260): setReadTimeout with 30000ms
I/System.out(18260): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(18260): (HTTPLog)-Static: isSBSettingEnabled false

@Gustl22
Copy link
Collaborator

Gustl22 commented Sep 3, 2022

Did you add usesCleartextTraffic in Android Manifest?

@Gustl22 Gustl22 added the waiting for report Wait for the author to respond to the conversation label Sep 3, 2022
@Z6P0
Copy link
Author

Z6P0 commented Sep 5, 2022

Did you add usesCleartextTraffic in Android Manifest?

Yes but it's useless as it's a HTTPS link here.

@Gustl22
Copy link
Collaborator

Gustl22 commented Sep 21, 2022

I also get an error, but another one, so usesCleartextTraffic should work fine, also to accept invalid ssl connections:

java.io.IOException: Prepare failed.: status=0x1
	at android.media.MediaPlayer._prepare(Native Method)
	at android.media.MediaPlayer.prepare(MediaPlayer.java:1276)
	at xyz.luan.audioplayers.player.MediaPlayerPlayer.prepare(MediaPlayerPlayer.kt:89)
	at xyz.luan.audioplayers.player.WrappedPlayer.configAndPrepare(WrappedPlayer.kt:310)
	at xyz.luan.audioplayers.player.WrappedPlayer.setSource(WrappedPlayer.kt:31)
	at xyz.luan.audioplayers.AudioplayersPlugin.handler(AudioplayersPlugin.kt:89)
	at xyz.luan.audioplayers.AudioplayersPlugin.access$handler(AudioplayersPlugin.kt:23)
	at xyz.luan.audioplayers.AudioplayersPlugin$onAttachedToEngine$1$1.invoke(AudioplayersPlugin.kt:39)
	at xyz.luan.audioplayers.AudioplayersPlugin$onAttachedToEngine$1$1.invoke(AudioplayersPlugin.kt:39)
	at xyz.luan.audioplayers.AudioplayersPlugin$safeCall$1.invokeSuspend(AudioplayersPlugin.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

@Gustl22
Copy link
Collaborator

Gustl22 commented Sep 21, 2022

But https://streaming-canal-u.fmsh.fr without valid certificate is forwarded to https://vod.canal-u.tv/ with a valid certificate.
I don't think my error comes from the certificate rather than the forwarding. If I play it from the forwarded source, it works fine.
Do you have a file url, which is not forwarded to another server and uses an invalid certificate?

@Z6P0
Copy link
Author

Z6P0 commented Sep 26, 2022

Do you have a file url, which is not forwarded to another server and uses an invalid certificate?

Here is an example: https://cdn-preview-e.deezer.com/stream/c-e6b5f2295c3af5280cc00b3bf842ff57-9.mp3

@Gustl22 Gustl22 removed the waiting for report Wait for the author to respond to the conversation label Oct 6, 2022
@Gustl22
Copy link
Collaborator

Gustl22 commented Oct 8, 2022

Confirmed, but still getting:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Unexpected error!, Prepare failed.: status=0x1, java.io.IOException: Prepare failed.: status=0x1
E/flutter ( 4651): 	at android.media.MediaPlayer._prepare(Native Method)
E/flutter ( 4651): 	at android.media.MediaPlayer.prepare(MediaPlayer.java:1276)
E/flutter ( 4651): 	at xyz.luan.audioplayers.player.MediaPlayerPlayer.prepare(MediaPlayerPlayer.kt:89)
E/flutter ( 4651): 	at xyz.luan.audioplayers.player.WrappedPlayer.configAndPrepare(WrappedPlayer.kt:310)
E/flutter ( 4651): 	at xyz.luan.audioplayers.player.WrappedPlayer.setSource(WrappedPlayer.kt:31)
E/flutter ( 4651): 	at xyz.luan.audioplayers.AudioplayersPlugin.handler(AudioplayersPlugin.kt:91)
E/flutter ( 4651): 	at xyz.luan.audioplayers.AudioplayersPlugin.access$handler(AudioplayersPlugin.kt:25)
E/flutter ( 4651): 	at xyz.luan.audioplayers.AudioplayersPlugin$onAttachedToEngine$1$1.invoke(AudioplayersPlugin.kt:41)
E/flutter ( 4651): 	at xyz.luan.audioplayers.AudioplayersPlugin$onAttachedToEngine$1$1.invoke(AudioplayersPlugin.kt:41)
E/flutter ( 4651): 	at xyz.luan.audioplayers.AudioplayersPlugin$safeCall$1.invokeSuspend(AudioplayersPlugin.kt:62)
E/flutter ( 4651): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/flutter ( 4651): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/flutter ( 4651): 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
E/flutter ( 4651): 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
E/flutter ( 4651): 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
E/flutter ( 4651): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
E/flutter ( 4651): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
E/flutter ( 4651): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
E/flutter ( 4651): , null)
E/flutter ( 4651): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter ( 4651): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter ( 4651): <asynchronous suspension>
E/flutter ( 4651): #2      _SourcesTabState.setSource (package:audioplayers_example/tabs/sources.dart:39:7)
E/flutter ( 4651): <asynchronous suspension>

@Gustl22 Gustl22 added the reproducible Bug can be reproduced label Oct 8, 2022
@Gustl22
Copy link
Collaborator

Gustl22 commented Dec 23, 2022

Note: this is not #1260 as this is using proper mp3 codec and is playable as asset source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-android Affects the android platform reproducible Bug can be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants