X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b6964cb031b5aa25c34b06ba77540ab06fab2005..1a9cec16fe8d805dbb9f3a082bebcdefb878cf13:/lisp/net/network-stream.el diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 0104fa7dd1..59ac2995c0 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -1,6 +1,6 @@ ;;; network-stream.el --- open network processes, possibly with encryption -;; Copyright (C) 2010-2015 Free Software Foundation, Inc. +;; Copyright (C) 2010-2016 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: network @@ -46,6 +46,7 @@ (require 'starttls) (require 'auth-source) (require 'nsm) +(require 'puny) (autoload 'gnutls-negotiate "gnutls") (autoload 'open-gnutls-stream "gnutls") @@ -121,7 +122,7 @@ values: :client-certificate should either be a list where the first element is the certificate key file name, and the second - element is the certificate file name itself, or `t', which + element is the certificate file name itself, or t, which means that `auth-source' will be queried for the key and the certificate. This parameter will only be used when doing TLS or STARTTLS connections. @@ -148,7 +149,7 @@ asynchronously, if possible." (plist-get parameters :capability-command)))))) ;; The simplest case: wrapper around `make-network-process'. (make-network-process :name name :buffer buffer - :host host :service service + :host (puny-encode-domain host) :service service :nowait (plist-get parameters :nowait)) (let ((work-buffer (or buffer (generate-new-buffer " *stream buffer*"))) @@ -198,7 +199,8 @@ asynchronously, if possible." (defun network-stream-open-plain (name buffer host service parameters) (let ((start (with-current-buffer buffer (point))) (stream (make-network-process :name name :buffer buffer - :host host :service service + :host (puny-encode-domain host) + :service service :nowait (plist-get parameters :nowait)))) (when (plist-get parameters :warn-unless-encrypted) (setq stream (nsm-verify-connection stream host service nil t))) @@ -219,7 +221,8 @@ asynchronously, if possible." eoc)) ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE) (stream (make-network-process :name name :buffer buffer - :host host :service service)) + :host (puny-encode-domain host) + :service service)) (greeting (and (not (plist-get parameters :nogreeting)) (network-stream-get-response stream start eoc))) (capabilities (network-stream-command stream capability-command @@ -296,7 +299,8 @@ asynchronously, if possible." (unless require-tls (setq stream (make-network-process :name name :buffer buffer - :host host :service service)) + :host (puny-encode-domain host) + :service service)) (network-stream-get-response stream start eoc))) ;; Re-get the capabilities, which may have now changed. (setq capabilities