From: Lars Ingebrigtsen Date: Thu, 14 Apr 2022 16:08:00 +0000 (+0200) Subject: Handle non-ASCII domains correctly in url-https-proxy-connect X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~2370^2~572 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=346749f67db3fd2c0cca0b5615d9fc3f878aa65f;p=emacs.git Handle non-ASCII domains correctly in url-https-proxy-connect * lisp/url/url-http.el (url-https-proxy-connect) (url-https-proxy-after-change-function): Handle IDNA domains correctly. --- diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index daeba17031d..96a47429569 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1405,10 +1405,10 @@ The return value of this function is the retrieval buffer." (and proxy-auth (concat "Proxy-Authorization: " proxy-auth "\r\n"))) "\r\n") - (url-host url-current-object) + (puny-encode-domain (url-host url-current-object)) (or (url-port url-current-object) url-https-default-port) - (url-host url-current-object)))) + (puny-encode-domain (url-host url-current-object))))) (defun url-https-proxy-after-change-function (_st _nd _length) (let* ((process-buffer (current-buffer)) @@ -1430,12 +1430,12 @@ The return value of this function is the retrieval buffer." (condition-case e (let ((tls-connection (gnutls-negotiate :process proc - :hostname (url-host url-current-object) + :hostname (puny-encode-domain (url-host url-current-object)) :verify-error nil))) ;; check certificate validity (setq tls-connection (nsm-verify-connection tls-connection - (url-host url-current-object) + (puny-encode-domain (url-host url-current-object)) (url-port url-current-object))) (with-current-buffer process-buffer (erase-buffer)) (set-process-buffer tls-connection process-buffer)