Page 1 of 1

DownloadFile with https protocol

Posted: Mon Feb 24, 2014 10:58 pm
by yssing
When I try to download a file from the web, on an https connection via DownloadFile() it fails with a "Unknown protocol in URL!"
I can download them using http, but its not enough in my case.
Is there any way to download files using the https?

Re: DownloadFile with https protocol

Posted: Tue Feb 25, 2014 8:12 am
by Bugala
Whiel waiting for someone who actually knows, this is just a guess, since I am not that well aware of this topic, but https, that last letter s probably means "security" or something similar. Which means that there might be some sort of encryption in place, which in turn means that to download from https address you would need some sort of encryption in place. Maybe a plugin that is not existing yet.

Re: DownloadFile with https protocol

Posted: Tue Feb 25, 2014 10:45 am
by yssing
Yes exactly, and that is the problem.
But if some one did have a fix for it, I would be very happy.

Re: DownloadFile with https protocol

Posted: Tue Feb 25, 2014 10:46 pm
by JurassicC
https uses tcp port 443 not 80.
you could try
Downloadfile("https://www.yourserver.com:443/file")...... dont know if that would work

or

OpenConnection(1, yoursever.com , 443)
Then use http get and put commands via receivedata to get the necessary file.

Edit you cant use download file this is what you get back

<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>

Re: DownloadFile with https protocol

Posted: Tue Feb 25, 2014 11:40 pm
by JurassicC
This doesnt work either

OpenConnection (1, "www.djangoproject.com", 443)
SendData(1, "GET https://www.djangoproject.com/m/release ... 6.2.tar.gz ".."/HTTP/1.0\r\n\r\n")
a$=ReceiveData(1, #RECEIVEALL)
CloseConnection(1)
OpenFile(1, "downloadedfile", #MODE_WRITE)
WriteLine(1,a$)
CloseFile(1)

It looks like to emulate a https get request there would need to be an opensslconnection function

Re: DownloadFile with https protocol

Posted: Wed Feb 26, 2014 3:58 pm
by yssing
I tried the same on windows hollywood, the same result.
The plain HTTP request was sent to HTTPS port

Re: DownloadFile with https protocol

Posted: Wed Feb 26, 2014 4:44 pm
by airsoftsoftwair
HTTPS needs SSL support which Hollywood currently doesn't provide. You can use wget or some other external program as a workaround.