Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu _add_apt_repository needs to pass both http_proxy and https_proxy for some PPA keys to be found #544

Open
afreiberger opened this issue Dec 8, 2020 · 0 comments

Comments

@afreiberger
Copy link
Contributor

Add-apt-repository requires both http_proxy and https_proxy settings for some PPAs.

This line integrates the https proxy variable into the call used by a charm to add-apt-repository, but while some keys are served by keyserver.ubuntu.com via https, some are also pointing to http endpoints and failing to be proxied.

cmd_env=env_proxy_settings(['https']))

As an example, I'm able to add ppa:telegraf-devs/ppa from the CLI if I set both http_proxy and https_proxy, but it fails on just https_proxy being set.

ubuntu@host:~$ sudo https_proxy=http://10.0.0.1:8000/ add-apt-repository ppa:telegraf-devs/ppa
 
 More info: https://launchpad.net/~telegraf-devs/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmphx3xn4br/secring.gpg' created
gpg: keyring `/tmp/tmphx3xn4br/pubring.gpg' created
gpg: requesting key C94406F5 from hkp server keyserver.ubuntu.com
?: [fd 4]: read error: Connection reset by peer
gpgkeys: HTTP fetch error 7: couldn't connect: eof
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: keyserver unreachable
gpg: keyserver communications error: public key not found
gpg: keyserver receive failed: public key not found
Failed to add key.
ubuntu@host:~$ sudo http_proxy=http://10.0.0.1:8000/ https_proxy=http://10.0.0.1:8000/ add-apt-repository ppa:telegraf-devs/ppa
 
 More info: https://launchpad.net/~telegraf-devs/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp42e10sgd/secring.gpg' created
gpg: keyring `/tmp/tmp42e10sgd/pubring.gpg' created
gpg: requesting key C94406F5 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp42e10sgd/trustdb.gpg: trustdb created
gpg: key C94406F5: public key "Launchpad PPA for Telegraf Devs" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant