PC Review


Reply
Thread Tools Rate Thread

Downloading file over HTTPS not working for all files

 
 
Berco Beute
Guest
Posts: n/a
 
      11th Jun 2010
In my C# .Net CF 3.5 app for a Windows CE 5 device I can easily
download an XML from one of my servers over HTTPS, but somehow it
constantly fails when I want to download a binary file. I am testing
it on a real device connected via USB cable to my computer. The
exception that is thrown can be seen below. If I move the same file to
another server where it still is served over HTTPS there is no problem
at all.

I have tried all possible header combinations and even checked whether
the server first sends an "empty encryption packet" as described here:

http://blogs.msdn.com/b/andrewarnott...b-servers.aspx

That wasn't the case, and if it was it would show up when downloading
the XML file as well. I have the feeling I am out of options here. Any
suggestions would be highly appreciated.

=== HEADERS =================

getString.Append("Host: www.somehost.com\r\n");
getString.Append("User-Agent: Windows Mobile 5 CE\r\n");
getString.Append("Accept: text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8\r\n");
getString.Append("Accept-Encoding: gzip,deflate\r\n");
getString.Append("Keep-Alive: 300\r\n");
getString.Append("Connection: keep-alive\r\n");
getString.Append("Content-Type: application/octet-stream\r\n");
getString.Append("Accept-Language: en-us,en;q=0.5\r\n");
getString.Append("Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r
\n");


=== EXCEPTION ================
Unable to read data from the transport connection.

at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at app.FileDownloader.downloadFile(String downloadUrl, String
localFile)
at app.SelectEventForm.onOKButtonClick(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam,
Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32
wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at scanware.Scanware..ctor()
at scanware.Program.Main()
===================
 
Reply With Quote
 
 
 
 
Berco Beute
Guest
Posts: n/a
 
      12th Jun 2010
It is because the server is using a wildcard certificate
(*.domain.com) which Windows Mobile 5 doesn't support. I'm quoting
from:

http://www.sslshopper.com/best-ssl-w...rtificate.html

"Disadvantages of SSL Wildcard Certificates:
Mobile Device Compatibility. Some popular mobile device operating
systems, including Windows Mobile 5, don't recognize the wildcard
character (*) and therefore can't use a wildcard certificate. If you
need to support these devices you will need to use a single
certificate, a UC certificate, or a wildcard certificate with Subject
Alternative Names."

Pretty bad luck.
 
Reply With Quote
 
Berco Beute
Guest
Posts: n/a
 
      12th Jun 2010
On second thought that doesn't explain the fact that I CAN download an
XML file from the exact same server over HTTPS. The only difference
with the call that fails is that the latter is a binary file (content-
type: application/octet-stream).

I've tried setting a custom ServicepointManager.CertificatePolicy
property:

http://www.eggheadcafe.com/community...hing-cert.aspx

That didn't help either. Somehow my custom CheckValidationResult
method (which always returns 'true') never gets called.

Now the question is at exact which moment the problem occurs. Is it
because of wildcard certificates? Because of binary data?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading a file from an HTTPS server requiring a digital certificate Eddie Lascu Microsoft VB .NET 0 11th Jul 2007 07:19 PM
Downloading a CSV file not working April Windows XP Basics 5 26th Sep 2006 10:27 PM
Re: HttpWebRequest, HTTPS, Downloading a file - SOLVED cxd3000@gmail.com Microsoft Dot NET Framework 1 24th Mar 2005 02:53 AM
https causes IE to crash when downloading PDF file Bill Windows XP Internet Explorer 1 24th Sep 2004 01:50 AM
HTTPS and file downloading 0k Microsoft ASP .NET 0 29th Oct 2003 02:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 AM.