Ubuntu – Proxy settings for snap store

networkingPROXY

This has been really frustrating, and pretty much unsolvable for me.

I am on an university network, so naturally I use proxy. I have set proxy appropriately in /etc/environment. But, always, no matter what I do, there's always this error:

   https://api.snapcraft.io/v2/snaps/refresh: proxyconnect tcp: tls:
   oversized record received with length 20527

I have restarted, reset, removed and installed snap, but time and again, there's no solution. The past solutions are no help, and anything I do doesn't change the errors. Is snap store really unusable in a proxy?

Edit: I changed a few things, and now I get a differnt error:

   https://api.snapcraft.io/v2/snaps/refresh: Proxy Authentication Required

This is really infuriating because wherever I use proxy, I use the format

username:password@host:port

whether it is /etc/environment, ~/.bashrc or /etc/apt/apt.conf. I have no problem in connectivity via apt, and wget works fine too. It's snap that snaps me.

Best Answer

To use a proxy server with snapd, I replaced the following line in /etc/systemd/system/snapd.service.d/https-proxy.conf.

Environment="https_proxy=https://192.168.14.14:3128/"

I replaced https:// with http://.

Environment="https_proxy=http://192.168.14.14:3128/"

I got the idea reading Got error "tls: oversized record received with length 20527" when using https_proxy for oc exec.