I'm trying to use ELPA behind a proxy which requires authentication.
I've found out that ELPA's connection relies on the URL package, which
prompts me for a username and a password. I'd like to set such
credentials on Emacs startup, and I've found out they should go into
".authinfo" file. I've also found out that you can use an encrypted
".authinfo.gpg". Thus, here is my setup:
auth-sources: ((:source "~/.authinfo.gpg" :host t :protocol t)
Then, content of "~/.authinfo.gpg" is like this:
machine <proxy-address> port <proxy-port> login <my-username> password
<my-password>
These settings are being ignored when using "package-list-packages".
However I'm asked for a password to open "~/.authinfo.gpg".
Any hints? Thanks.
That is:
machine <proxy-address>:<proxy-port> port http login <my-username>
password <my-password>
E> I've also tried a different "~/.authinfo.gpg" format as suggested
E> here:
E> That is:
E> machine <proxy-address>:<proxy-port> port http login <my-username>
E> password <my-password>
From (info "(auth)Help for users"):
For url-auth authentication (HTTP/HTTPS), you need to put this in
your netrc file:
machine yourmachine.com:80 port http login testuser password testpass
This will match any realm and authentication method (basic or digest)
over HTTP. HTTPS is set up similarly. If you want finer controls,
explore the url-auth source code and variables.
Please try that. See the auth-source manual (info "(auth)") for more
information.
Ted
I did read the documentation before asking, but only setting the
environment variable "http_proxy" fixed the issue.