]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle non-ASCII domains correctly in url-https-proxy-connect
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 14 Apr 2022 16:08:00 +0000 (18:08 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 14 Apr 2022 16:08:00 +0000 (18:08 +0200)
* lisp/url/url-http.el (url-https-proxy-connect)
(url-https-proxy-after-change-function): Handle IDNA domains
correctly.

lisp/url/url-http.el

index daeba17031dd9c731db71cf5307e80c33291e435..96a47429569f14b5a4480bff899150dc30addfb6 100644 (file)
@@ -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)