I'm having trouble accessing ELPA on my Mac from behind a corporate proxy. Emacs 27.1.
I have http_proxy
and https_proxy
configured appropriately (I've also tried setting url-proxy-services
).
From Emacs (M-x package-refresh-contents
):
Using a proxy for https...
Contacting host: elpa.gnu.org:443
elpa.gnu.org/0 nodename nor servname provided, or not known
Package refresh done
Failed to download ‘gnu’ archive.
From Terminal:
hostname:~ 000$ gnutls-cli -V --ca-verification --x509cafile=/tmp/master.pem elpa.gnu.org
Processed 205 CA certificate(s).
Resolving 'elpa.gnu.org:443'...
Cannot resolve elpa.gnu.org:443: nodename nor servname provided, or not known
hostname:~ 000$ nslookup elpa.gnu.org
Server: XXX.XXX.XXX.XXX
Address: XXX.XXX.XXX.XXX#53
** server can't find elpa.gnu.org: NXDOMAIN
It looks like gnutls
and nslookup
are having trouble resolving the domain (nodename nor servname provided, or not known
is the same error that Emacs is throwing).
However curl
has no issues:
hostname:~ 000$ curl elpa.gnu.org|head
<!doctype html>
<html>
<head>
<title>GNU Emacs Lisp Package Archive</title>
What am I missing?
GET http://elpa.gnu.org/ HTTP/1.1
to the proxy server 2) ask package.el to use HTTP, instead of HTTPS, GNU Elpa supports both.(setq url-proxy-services '(("http" . "localhost:1234") ...))
5) you can test your proxy viacurl -v -x http://localhost:1234 example.com