Requirements:
- Not using libcurl (because that's a C binding, then we'd have no security enhancement and could just stick to curl).
- force use TLSv1, not SSL
- Download head only. (Similar to curls --head.)
- Features. With example.
/usr/lib/sdwdate/url_to_unixtime \ --max-time 180 \ --socks5-hostname 10.152.152.10:9108 \ --tls true \ https://check.torproject.org
Expected output, unixtime, example:
1413814230
Bonus:
--max-file-size-bytes 2097152 --user-agent --verbose
SSL:
Depending on the outcome of this we might not need SSL support.
date_to_unixtime:
The code for date to unixtime is already done:
https://github.com/Whonix/sdwdate/blob/master/usr/lib/sdwdate/date_to_unixtime
python-requests:
Implementing this using the [python-requests](http://docs.python-requests.org) library was trivial, but unfortunately, python-requests does not support socks proxies yet, which is a deal breaker for Whonix.
urllib3:
Has no yet socks proxy support either.
TODO:
So we have to find some python library that has socks proxy as well as TLSv1 support, that is installable from Debian repository. Does this exist?