I'm currently running squid-deb-proxy to cache apt-related downloads, I was wondering if the same could be done with snaps as well.
2 Answers
The squid-deb-proxy works because the files are served over plain HTTP, and generally do not require authentication (ones that do are usually over HTTPS and tend to not be cached).
Snaps however, are served over HTTPS due to the inherent requirements of authenticating to the store, and the possibility that some snaps are for purchase, and similar situations. To cache the data via a proxy, you will need to break the TLS connection by creating a certificate which you own, and which can be seen as valid by snapd when it attempts to verify the certificate.
- 40,344
- 5
- 56
- 98
-
That's unfortunate, so that means aside from having a convoluted setup, there's no easy way to do this? I've had a working squid with ssl enabled before but success seem to be a hit 'n miss in most cases, decided to scrap it all together. – Rey Leonard Amorato Jun 09 '18 at 11:43
-
Well, it's HTTPS, and all traffic is end-to-end encrypted, so in order to cache it somewhere in the middle, you obviously need to break that encryption. You could cache chunks of encrypted data, but there's no way to know what the data contains, or if it will remain valid (even if it was valid, it'd only still be valid for the one client, not all clients in the network). – dobey Jun 09 '18 at 12:16
At the first glance Ubuntu has Snap Store Proxy but then if you'd look closer into it you'll realise they expect that:
- you shall tinker with Postgresql
- configure some un-explained "domain name"
- generate keys and then register this proxy
- wait till they approve it
and only then you'd be able to save time and traffic with caching… "For evaluation purposes, we automatically grant the use of up to 5 devices."
- 324
- 1
- 12
-
This last comment is gone now. It seems you can use unlimited number of devices – Adam Ryczkowski Feb 15 '20 at 18:29