Comments, Code and Qt. Some words about the wonderful world of software engineering


Why doesn’t Windows Phone 8 support HTTPS?

Posted by kypeli

Let me start by saying that of course does Windows Phone 8 support HTTPS in the browser, but it seems some HTTP related APIs do not. As I am developing my podcast client for Windows Phone, I occasionally get bug reports from Windows Phone 8 users that I can't reproduce on my Windows Phone 7 device. This is one of those. I use BackgroundFileTransfer and BackgroundAudioPlayer components in my podcast client. Both of them operate on HTTP(S) endpoints as clients. But I got a bug report the other day say saying that the download failed on a file and the same (audio) file cannot be played in the player. I had to start digging deeper, as the same media file does work without issues on my Windows Phone 7 device. It turns out that the file in question is behind a HTTPS endpoint. I don't know if it matters, but the server returns HTTP code 301 (Permanently moved) which means that the server requests the client to go look for the content from another location that it specifies. I looked at the network traffic using Wireshark. It turns out, as you can see below, that Windows Phone 8 terminates the connection after the initial SSL handshake by sending TCP package with [FIN, ACK]. Windows Phone 8 just throws in the towel and gives up.


On the other hand Windows Phone 7 responds at the same location with a TCP [SYN] package which means it wants to continue the communication. It gets the HTTP code 301 as response and moves happily on.


So why doesn't Windows Phone 8 support HTTPS? I have made Microsoft aware of this issue by posting on to their forum a question: I have not yet received a response. Update: So I got a response to the forums from Microsoft saying they are indeed investigating this issue, which is very nice! Thanks 🙂 And it also turns out that very likely, this is related to the HTTPS -> HTTP change in the connection. As you can see from the WP7 traces, it's WP7 doing the first HTTP request which means it already got the HTTP 301 response from the server - over HTTPS. Hence it's not visible in the trace. So I think Microsoft tried to do something to enhance the security, but broke the experience. And I really hope they find this a bug, as this would be unexpected behavior from a browser, so why would these HTTP APIs behave differently and break things? At least give me an option to use this "insecure" way of communication.

Technorati Tags: , , ,


Windows Phone 7.5: BackgroundAudioPlayer crashes for published apps

Posted by kypeli

I have been developing a podcast client for Windows Phone for the past few months - just for my own pleasure, to learn Windows Phone development and to have a decent podcast client for Windows Phone. Because it is a podcast client, I need the ability to play MP3 files and lucky for me, Window Phone 7.5 provides a mechanism for this called BackgroundAudioPlayer. It's a bit clunky to set up, but in the end quite straightforward thanks to some pretty good instructions. I got all the pieces of the software working together and I was pretty happy of how it all worked out for me in the end. Including the audio player was working fine. Until I submitted the app for publishing to the Windows Phone Marketplace, that is. The certification failed because "starting to play any podcast episode resulted in a crash". I was quite baffled. I had, after all, been using my own podcast client to listen to my own podcasts for quite some time, including playing them of course. And I mean playing a lot, since I had been using the app for quite some time before I did the submission to Marketplace. This was driving me nuts because I just couldn't reproduce the issue (ok, to be frank I had other issues I had to fix too, but the root cause I couldn't reproduce). Thanks to a brave and kind beta-tester I managed to finally get closer to the truth, because he could reproduce the crash on his device and the version that was downloaded from the Marketplace through the beta-program.

Technorati Tags: , , , ,