Move tls.el and starttls.el to lisp/obsolete/ (Bug#31457)

* lisp/obsolete/tls.el: Moved from lisp/net/tls.el.
* lisp/gnus/nnimap.el:
* lisp/url/url-http.el: Don't require tls, since it's obsolete.
* lisp/net/network-stream.el: Only require tls if we actually try to
use it (i.e., when (gnutls-available-p) returns nil).  Declare some
functions to fix compilation warnings.

* lisp/obsolete/starttls.el: Moved from lisp/net/starttls.el.
* lisp/net/sieve-manage.el:
* lisp/net/network-stream.el: Don't require `starttls' at the
top-level, declare the variables and functions used instead.
(network-stream-open-starttls): Only require `starttls' if
needed (i.e., gnutls-available-p fails).

* etc/NEWS: Announce obsoletion.
This commit is contained in:
Noam Postavsky 2017-07-13 08:52:39 -04:00
parent 1d9d35a4e8
commit 97d5d1a1f4
7 changed files with 22 additions and 7 deletions

View file

@ -485,6 +485,10 @@ Tramp for some look-alike remote file names.
** The options.el library has been removed.
It was obsolete since Emacs 22.1, replaced by customize.
** The tls.el and starttls.el libraries are now marked obsolete.
Use of built-in libgnutls based functionality (described in the Emacs
GnuTLS manual) is recommended instead.
** Message

View file

@ -36,7 +36,6 @@
(require 'nnoo)
(require 'netrc)
(require 'utf7)
(require 'tls)
(require 'parse-time)
(require 'nnmail)

View file

@ -42,14 +42,20 @@
;;; Code:
(require 'tls)
(require 'starttls)
(require 'auth-source)
(require 'nsm)
(require 'puny)
(declare-function starttls-available-p "starttls" ())
(declare-function starttls-negotiate "starttls" (process))
(autoload 'gnutls-negotiate "gnutls")
(autoload 'open-gnutls-stream "gnutls")
(defvar starttls-extra-arguments)
(defvar starttls-extra-args)
(defvar starttls-use-gnutls)
(defvar starttls-gnutls-program)
(defvar starttls-program)
;;;###autoload
(defun open-network-stream (name buffer host service &rest parameters)
@ -255,7 +261,8 @@ gnutls-boot (as returned by `gnutls-boot-parameters')."
(or (gnutls-available-p)
(and (or require-tls
(plist-get parameters :use-starttls-if-possible))
(starttls-available-p))))
(require 'starttls)
(starttls-available-p))))
(not (eq (plist-get parameters :type) 'plain)))
;; If using external STARTTLS, drop this connection and start
;; anew with `starttls-open-stream'.
@ -336,7 +343,8 @@ gnutls-boot (as returned by `gnutls-boot-parameters')."
;; See `starttls-available-p'. If this predicate
;; changes to allow running under Windows, the error
;; message below should be amended.
(if (memq system-type '(windows-nt ms-dos))
(if (or (memq system-type '(windows-nt ms-dos))
(not (featurep 'starttls)))
(concat "Emacs does not support TLS")
(concat "Emacs does not support TLS, and no external `"
(if starttls-use-gnutls
@ -373,6 +381,8 @@ gnutls-boot (as returned by `gnutls-boot-parameters')."
(unless (= start (point))
(buffer-substring start (point)))))))
(declare-function open-tls-stream "tls" (name buffer host port))
(defun network-stream-open-tls (name buffer host service parameters)
(with-current-buffer buffer
(let* ((start (point-max))
@ -380,6 +390,7 @@ gnutls-boot (as returned by `gnutls-boot-parameters')."
(if (gnutls-available-p)
(open-gnutls-stream name buffer host service
(plist-get parameters :nowait))
(require 'tls)
(open-tls-stream name buffer host service)))
(eoc (plist-get parameters :end-of-command)))
(if (plist-get parameters :nowait)
@ -406,6 +417,9 @@ gnutls-boot (as returned by `gnutls-boot-parameters')."
(network-stream-command stream capability-command eo-capa)
'tls)))))))
(declare-function format-spec "format-spec" (format spec))
(declare-function format-spec-make "format-spec" (&rest pairs))
(defun network-stream-open-shell (name buffer host service parameters)
(require 'format-spec)
(let* ((capability-command (plist-get parameters :capability-command))

View file

@ -77,7 +77,6 @@
(eval-when-compile (require 'cl-lib))
(require 'sasl)
(require 'starttls)
(autoload 'sasl-find-mechanism "sasl")
(autoload 'auth-source-search "auth-source")

View file

@ -1600,7 +1600,6 @@ p3p
;; HTTPS. This used to be in url-https.el, but that file collides
;; with url-http.el on systems with 8-character file names.
(require 'tls)
(defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.")