Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-14146

Cannot play media from https urls (SSL) on Android 4.4 KitKat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • cordova-plugin-media

    Description

      From Ken Naito:

      I have investigated the test failure for Android 4.4. For
      cordova-plugin-media, the cause of the failure may be the SSL handshake.
      
      The MediaPlayer in Android 4.4 can not connect to a modern SSL server.
      For example:
      https://cordova.apache.org/downloads/BlueZedEx.mp3
      https://cordova-develop.github.io/cordova-plugin-media/res/BlueZedEx.mp3
      
      On the other hand, the MediaPlayer can connect to a standard SSL server
      like:
      https://www.asial.co.jp/data_knaito/BlueZedEx.mp3
      
      I have checked the packet, and the available cipher suites of Android
      4.4 are as follows:
      
      ECDHE-RSA-AES256-CBC-SHA
      ECDHE-ECDSA-AES256-CBC-SHA
      SRP-SHA-DSS-AES256-CBC-SHA
      SRP-SHA-RSA-AES256-CBC-SHA
      DHE-RSA-AES256-CBC-SHA
      DHE-DSS-AES256-CBC-SHA
      ECDH-RSA-AES256-CBC-SHA
      ECDH-ECDSA-AES256-CBC-SHA
      RSA-AES256-CBC-SHA
      ECDHE-RSA-3DES-EDE-CBC-SHA
      ECDHE-ECDSA-3DES-EDE-CBC-SHA
      SRP-SHA-DSS-3DES-EDE-CBC-SHA
      SRP-SHA-RSA-3DES-EDE-CBC-SHA
      DHE-RSA-3DES-EDE-CBC-SHA
      DHE-DSS-3DES-EDE-CBC-SHA
      ECDH-RSA-3DES-EDE-CBC-SHA
      ECDH-ECDSA-3DES-EDE-CBC-SHA
      RSA-3DES-EDE-CBC-SHA
      ECDHE-RSA-AES128-CBC-SHA
      ECDHE-ECDSA-AES128-CBC-SHA
      SRP-SHA-DSS-AES128-CBC-SHA
      SRP-SHA-RSA-AES128-CBC-SHA
      DHE-RSA-AES128-CBC-SHA
      DHE-DSS-AES128-CBC-SHA
      ECDH-RSA-AES128-CBC-SHA
      ECDH-ECDSA-AES128-CBC-SHA
      RSA-AES128-CBC-SHA
      ECDHE-RSA-RC4-SHA
      ECDHE-ECDSA-RC4-SHA
      ECDH-RSA-RC4-SHA
      ECDH-ECDSA-RC4-SHA
      RSA-RC4-SHA
      RSA-RC4-MD5
      
      Modern SSL servers may refuse these cipher suites.
      
      In order to resolve this issue, the mp3 file should be downloaded in
      another way and then be played by MediaPlayer.
      One way of downloading is using the okhttp library with a custom ssl
      socket factory.
      
      However, the okhttp library is not included in the latest
      cordova-android, and cordova-plugin-okhttp
      (https://github.com/MobileChromeApps/cordova-plugin-okhttp) is too old
      and not maintained.
      
      I think that a new okhttp plugin should be created, and
      cordova-plugin-media should depend on the new okhttp plugin in order to
      connect to a modern SSL server.
      
      Or, a more simple option is to specify that the MediaPlayer can not
      connect modern SSL servers for Android 4.4, and remove the test of
      playing streams for Android 4.4.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shazron Shazron Abdullah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: