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

disable ssl certificate validation when playing audio? #66

Open
warpdesign opened this issue Jan 21, 2022 · 2 comments
Open

disable ssl certificate validation when playing audio? #66

warpdesign opened this issue Jan 21, 2022 · 2 comments

Comments

@warpdesign
Copy link

I have Koel running on my local network. I have enabled ssl, but since it's only for my local network, I have self issued a certificate (which cannot be verified by the browser).

The app is running, but whenever I try to play a song, I get this error:

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
#0 AudioProvider.init. (package:app/providers/audio_provider.dart:37:40)
#1 _rootRunUnary (dart:async/zone.dart:1436:47)
#2 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#3 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#4 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#5 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#6 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
#7 _PendingEvents.schedule. (dart:async/stream_impl.dart:663:7)
#8 _rootRun (dart:async/zone.dart:1420:47)
#9 _CustomZone.run (dart:async/zone.dart:1328:19)
#10 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#11 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1276:23)
#12 _rootRun (dart:async/zone.dart:1428:13)
#13 _CustomZone.run (dar<…>
flutter: PlatformException(PLAY_ERROR, Cannot play https://zique.fr.local/play/30e58cc455e7d4f55c2bda3573123937?api_token=9%7CwQ8EfNXK93ZTPyvLBcZ2qStLH23MYa04jeM2zukA, The certificate for this server is invalid., null)

Is there a way to disable certificate validation when playing audio?

I tried to add these keys in Info.plist, which made the app running, but seem to have no impact on audio playback restrictions:

        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSAllowsArbitraryLoadsForMedia</key>
        <true/>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
        <key>NSAllowsLocalNetworking</key>
        <true/>
@warpdesign warpdesign changed the title disable ssl certificate validation? disable ssl certificate validation when playing audio? Jan 21, 2022
@warpdesign
Copy link
Author

warpdesign commented Jan 21, 2022

Finally I added this and am using no http, not https:

        <key>NSAppTransportSecurity</key>
        <dict>
                <key>NSAllowsArbitraryLoads</key>
                <true/>
        </dict>

Now I get no error but I still cannot hear any song (and nothing happens when taping a sound: I see no playback controls appearing,..).

@warpdesign
Copy link
Author

After some thoughts, I tried pointing the app to the Koel demo server: demo.koel.dev and playback doesn't work either.

I get the following error:

flutter: error caught: PlatformException(PLAY_ERROR, Cannot play https://demo.koel.dev/play/312efc46c3ef5a09f625870d83321f11?api_token=15291%7Cxhze0T1EGKeRaUHBMQZ3JBMSohoBYPVV0OOYjDPG, unknown error, null)
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
#0      AudioProvider.init.<anonymous closure> (package:app/providers/audio_provider.dart:37:40)
#1      _rootRunUnary (dart:async/zone.dart:1436:47)
#2      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#3      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#5      _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#6      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
#7      _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
#8      _rootRun (dart:async/zone.dart:1420:47)
#9      _CustomZone.run (dart:async/zone.dart:1328:19)
#10     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
#11     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
#12     _rootRun (dart:async/zone.dart:1428:13)
#13     _CustomZone.run (dar<…>
flutter: PlatformException(PLAY_ERROR, Cannot play https://demo.koel.dev/play/312efc46c3ef5a09f625870d83321f11?api_token=15291%7Cxhze0T1EGKeRaUHBMQZ3JBMSohoBYPVV0OOYjDPG, unknown error, null)
flutter: error caught: PlatformException(PLAY_ERROR, Cannot play https://demo.koel.dev/play/312efc46c3ef5a09f625870d83321f11?api_token=15291%7Cxhze0T1EGKeRaUHBMQZ3JBMSohoBYPVV0OOYjDPG, unknown error, null)

(I checked out the latest version from git: 28ceb01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant