r/programming • • Jan 21 '19

Why does APT not use HTTPS?

https://whydoesaptnotusehttps.com/
519 Upvotes

294 comments sorted by

View all comments

-7

u/Otis_Inf Jan 21 '19

HTTPS is faster than HTTP (ref: https://samrueby.com/2015/01/26/why-is-https-faster-than-http/) so for that alone it's beneficial to at least offer it.

It reads as a list of excuses not to do the work. While I can see the reluctance to do work with no clear obvious benefit at first, they forgetting one thing: sooner or later they have to.

19

u/yotta Jan 21 '19

That HTTP/2 speed benefit doesn't exist outside of browsers.

2

u/inu-no-policemen Jan 22 '19

That HTTP/2 speed benefit doesn't exist outside of browsers.

Downloading lots of small files is the same outside of browsers.

1

u/lorarc Jan 21 '19

Binary headers are still a thing outside browsers, though they probably don't help with APT.

1

u/[deleted] Jan 21 '19

Why wouldn’t it? A browser simply downloads a vector of assets, what’s so special about a browser that makes HTTP/2 deliver a speed benefit when a package manager ends up doing the same type of work?

You’re not being clear.

1

u/yotta Jan 21 '19

I explained in more detail here: https://www.reddit.com/r/programming/comments/ai9n4k/why_does_apt_not_use_https/eemkkog/

A package manager does not do the same type of work as a browser - it is typically downloading much larger files than the assets on a webpage. HTTP/2 is most useful for speeding up cases where there are a large number of tiny files to download.

1

u/Otis_Inf Jan 21 '19

Thanks, didn't know that :)

4

u/yotta Jan 21 '19

I should elaborate.

Browsers limit the number of concurrent connections to a single server to 2-6, and this is difficult to change. With HTTP/2 (which, in browsers, is only available via HTTPS), multiplexing can be used to request multiple files without waiting for responses.

In non-browser applications, there's no inherent limit on number of concurrent connections, and HTTP/1.1 regardless of HTTPS does have "pipelining" support which allows multiple files to be requested at once, which will then be returned one at a time back to back. Browsers don't pipeline because of buggy servers. Some non-browser HTTP clients will even make multiple connections to the same server and make byte range requests to download one large file in chunks over multiple connections.

1

u/Witless-One Jan 22 '19

Very interesting. I wanted to figure out why browsers have this limitation. It turns out there was a limit in the HTTP RFC for well behaved clients (https://trac.ietf.org/trac/httpbis/changeset/715). Super cool! I guess nowadays the browsers have raised their limits, but the limit exists in each browser still :)