Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading from HTTPS

Tags:

https

haskell

I'll keep it simple:
I'd like to download a file via HTTPS; methods I've tried haven't worked (Network.HTTP.Wget, Network.Curl, Network.Download).
Suggestions?
Thanks!

like image 319
amindfv Avatar asked Aug 03 '11 17:08

amindfv


People also ask

Is it safe to download from HTTPS?

HTTPS doesn't mean safe. Many people assume that an HTTPS connection means that the site is secure. In fact, HTTPS is increasingly being used by malicious sites, especially phishing ones.

Is it safe to download from HTTP sites?

Yes, there are plenty of security concerns with downloading over unencrypted lines. But if you must download content over unencrypted http, as is still done for some package repos, you need at least to verify the file you download in some other way.

Can you download files with HTTP?

Hypertext transfer protocol, or HTTP, and file transfer protocol, known as FTP, are two methods that allow you to upload or download files and pages from the Internet. The two have overlapping functions, and you can use either method to transfer files online.

How does HTTP file download work?

When a user clicks a download link and tries to download files, thebrowser sends an HTTP GET request to the web server. At the sametime the file name to be downloaded and the file location are alsosent with the HTTP GET request.


2 Answers

See the http-enumerator, it works with SSL as well as enumerator/iteratee IO (with the enumerator package). Hence you can pipe it into attoparsec via attoparsec-iterator and efficiently parse the data.

like image 69
alternative Avatar answered Sep 26 '22 03:09

alternative


This question comes up every once in a while:

The solution I use currently is:

import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L

main = simpleHttp "https://www.noisebridge.net/wiki/Noisebridge" >>= L.putStr

There is also an explanation of how to post with http-conduit in the link as well as a few answers with other methods.

like image 36
Davorak Avatar answered Sep 24 '22 03:09

Davorak