5

I have written a simple HTML code to play an audio file using the HTML5 audio tag on IPhone.

<audio controls="controls" autoplay="autoplay">
<source src="http://192.168.1.130/ab.wav>" type="audio/wav" preload="auto"/>
Your browser does not support the audio element.
</audio>

The above code works perfectly fine over safari. The problem comes when I change the Source URL from HTTP to HTTPS.

I started getting "This movie could not be played" error message.

I am using a certificate chain which is as follows:

VeriSign Trial Secure Server Root CA - G2 -> VeriSign Trial Secure Server CA - G2 -> ucbu-aricent-vm200

The certificate of the Root CA (above) is not available in Safari by default.

So I had attached the certificate for the certificate authority (both Root and Intermediate) to an email, and then added them in IPhone by clicking the attachments in the email.

But still I see that the SSL Handshake fails when Safari created a TCP session to transfer the WAV file.

NOTE: The SSL handshake goes successful when the TCP session is created to fetch the HTML file from the server. I had compared the network packets of the SSL handshake of HTML and WAV file scenarios and both of them were identical.

UiUx
  • 967
  • 2
  • 14
  • 25
ataggarwal
  • 51
  • 1
  • 3
  • 1
    Have you considered that maybe the HTTP/SSL for audio/video playback is not done by Safari (just hypothetical) – Andrea Feb 20 '12 at 17:27
  • 1
    Why not use a certificate you know is accepted by the OS? They're $12 on GoDaddy... – ceejayoz Feb 20 '12 at 17:57
  • 1
    After a lot of struggle I am able to resolve audio playback over HTTPS on Iphone. Also I have tested it on IPad and it working on it as well. It seems following things are required to make it work. 1) A certificate for Tomcat web server signed by a certificate authority which is trusted on Iphone. We have used StartCom CA authority to generate the certificate. 2) In the audio tag we have to use the hostname instead of IP address. It seems Safari is comparing the Certificate CN with the URL to confirm the Identity of the box. – ataggarwal Feb 26 '12 at 12:49
  • Can you please confirm if this works fine in Windows Phone 8 as well? I have been trying hard to make it work but then finally I have to design my own audio/video player to play media files over HTTPS source. – Pravesh Pesswani Oct 09 '13 at 04:38

1 Answers1

2

This was mentioned above by ceejoyez and again by the OP (Thank you both!), but I almost missed it as it wasn't an actual answer:

If you are serving the content over https you need to have a valid certificate or it will not play on iOS devices (or on Safari on a Mac).

See here for a related question.

Community
  • 1
  • 1
ajl
  • 821
  • 9
  • 16
  • Still have this issue. Although having a valid certificate and the correct Domain in certificate and Audio src. Ios 9.3. – marcel May 24 '16 at 16:02
  • marcel, is your certificate self-signed or from some trusted source? I ask because a self-signed cert can be valid, but I believe that it still triggers this problem. – ajl Aug 02 '16 at 13:55