File transfer (GET) via HTTPS
-
Hi all, here's my problem. Im developing an activex control to work as a "proxy" between a server and a pda. The users will go to a webpage and from that webpage, they will be able to update/change the configuration of our app on their pda. The problem is that sometimes, the files that we need to download are a bit too big to put in the asp generated code so we thought we'd let the activex control do the downloading to pc by itself. This works great with HTTP, using wininet, but fails misserably with HTTPS[1]. Ive checked out msdn and tried the things they say at http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q168151&[^] Im fairly new to this webstuff thingamajiggs so I thought I'd check to see if anyone has had similar problems with code working with HTTP but not HTTPS. [1] I get a webpage back saying: "ERROR: The requested URL could not be retrieved" “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
-
Hi all, here's my problem. Im developing an activex control to work as a "proxy" between a server and a pda. The users will go to a webpage and from that webpage, they will be able to update/change the configuration of our app on their pda. The problem is that sometimes, the files that we need to download are a bit too big to put in the asp generated code so we thought we'd let the activex control do the downloading to pc by itself. This works great with HTTP, using wininet, but fails misserably with HTTPS[1]. Ive checked out msdn and tried the things they say at http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q168151&[^] Im fairly new to this webstuff thingamajiggs so I thought I'd check to see if anyone has had similar problems with code working with HTTP but not HTTPS. [1] I get a webpage back saying: "ERROR: The requested URL could not be retrieved" “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
MSDN[^] contains a nice sample how to download a file as you need it. It works also fine with a https connection.
int x=1, y=5;
x^=y^=x^=y; // whats the content of x and y now?
ClickHereForHelp(); -
MSDN[^] contains a nice sample how to download a file as you need it. It works also fine with a https connection.
int x=1, y=5;
x^=y^=x^=y; // whats the content of x and y now?
ClickHereForHelp();Thanks, but I already got that part down. I guess I wasnt clear enough about the problem. :) My problem is this: Everything works dandy with normal http calls. If its a SSL connection I add INTERNET_DEFAULT_HTTPS_PORT to my InternetConnect call and add the flags INTERNET_FLAG_SECURE|INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|INTERNET_FLAG_IGNORE_CERT_CN_INVALID to my HttpOpenRequest call. When I run it (using InternetOpen, InternetConnect, HttpOpenRequest, HttpSendRequest, HttpQueryInfo and InternetReadFile) everything returns correct values, but the page/file being sent with https is not the file i requested, but some kind of error page.
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL:
www.mycurrentclient.com:0The following error was encountered:
- Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:
-
Missing or incorrect access protocol (should be `http://'' or similar)
-
Missing hostname
-
Illegal double-escape in the URL-Path
-
Illegal character in hostname; underscores are not allowed
Your cache administrator is root.
but when calling the exact same URL with a normal HTTP call, I receive the file I was looking for. So, I guess my question is this: Should I do something other than what MS states in their doc's to be able to do GET's with HTTPS, or could this be a problem with the site im connecting to/the computer im connecting from? “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
-
Thanks, but I already got that part down. I guess I wasnt clear enough about the problem. :) My problem is this: Everything works dandy with normal http calls. If its a SSL connection I add INTERNET_DEFAULT_HTTPS_PORT to my InternetConnect call and add the flags INTERNET_FLAG_SECURE|INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|INTERNET_FLAG_IGNORE_CERT_CN_INVALID to my HttpOpenRequest call. When I run it (using InternetOpen, InternetConnect, HttpOpenRequest, HttpSendRequest, HttpQueryInfo and InternetReadFile) everything returns correct values, but the page/file being sent with https is not the file i requested, but some kind of error page.
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL:
www.mycurrentclient.com:0The following error was encountered:
- Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:
-
Missing or incorrect access protocol (should be `http://'' or similar)
-
Missing hostname
-
Illegal double-escape in the URL-Path
-
Illegal character in hostname; underscores are not allowed
Your cache administrator is root.
but when calling the exact same URL with a normal HTTP call, I receive the file I was looking for. So, I guess my question is this: Should I do something other than what MS states in their doc's to be able to do GET's with HTTPS, or could this be a problem with the site im connecting to/the computer im connecting from? “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
Is the server correctly set up to handle https? Does it have any certificate?
int x=1, y=5;
x^=y^=x^=y; // whats the content of x and y now?
ClickHereForHelp(); -
Is the server correctly set up to handle https? Does it have any certificate?
int x=1, y=5;
x^=y^=x^=y; // whats the content of x and y now?
ClickHereForHelp();Yes, it is. I think I've found my error, but Im trying to re-verify it by having the webguys change something in the asp and I didnt want to post anything until I was sure it was fixed. The problem was me not using InternetCrackUrl (what a horrible name for a function ;P ), so I sent www.mycurrentcustomer.com/path as server and file.xxx as file in my requests. I changed it to www.mycurrentcustomer.com and path/file.xxx and it worked. :-O Weird that the old way worked for normal HTPP calls though... Anyway, thanks for the help! :beer: “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002