DownloadFile with https protocol

Find quick help here to get you started with Hollywood
Post Reply
yssing
Posts: 7
Joined: Wed Jan 15, 2014 5:57 pm

DownloadFile with https protocol

Post by yssing » Mon Feb 24, 2014 10:58 pm

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?

Bugala
Posts: 784
Joined: Sun Feb 14, 2010 7:11 pm

Re: DownloadFile with https protocol

Post by Bugala » Tue Feb 25, 2014 8:12 am

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.

yssing
Posts: 7
Joined: Wed Jan 15, 2014 5:57 pm

Re: DownloadFile with https protocol

Post by yssing » Tue Feb 25, 2014 10:45 am

Yes exactly, and that is the problem.
But if some one did have a fix for it, I would be very happy.

User avatar
JurassicC
Posts: 35
Joined: Fri May 25, 2012 9:48 pm

Re: DownloadFile with https protocol

Post by JurassicC » Tue Feb 25, 2014 10:46 pm

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>
AmigaOne X1000 - RadeonHD 7870, 4GB RAM - AmigaOS 4.1ß
AmigaOne X5000 - Radeon R7 250, 2GB RAM - AmigaOS 4.1ß

User avatar
JurassicC
Posts: 35
Joined: Fri May 25, 2012 9:48 pm

Re: DownloadFile with https protocol

Post by JurassicC » Tue Feb 25, 2014 11:40 pm

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
AmigaOne X1000 - RadeonHD 7870, 4GB RAM - AmigaOS 4.1ß
AmigaOne X5000 - Radeon R7 250, 2GB RAM - AmigaOS 4.1ß

yssing
Posts: 7
Joined: Wed Jan 15, 2014 5:57 pm

Re: DownloadFile with https protocol

Post by yssing » Wed Feb 26, 2014 3:58 pm

I tried the same on windows hollywood, the same result.
The plain HTTP request was sent to HTTPS port

User avatar
airsoftsoftwair
Posts: 3110
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: DownloadFile with https protocol

Post by airsoftsoftwair » Wed Feb 26, 2014 4:44 pm

HTTPS needs SSL support which Hollywood currently doesn't provide. You can use wget or some other external program as a workaround.

Post Reply