* proto-stream.el (proto-stream-always-use-starttls): New variable.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 27 Nov 2010 17:41:22 +0000 (18:41 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 27 Nov 2010 17:41:22 +0000 (18:41 +0100)
lisp/ChangeLog
lisp/proto-stream.el

index 9f3102d..438aef8 100644 (file)
@@ -1,5 +1,7 @@
 2010-11-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * proto-stream.el (proto-stream-always-use-starttls): New variable.
+
        * nntp.el (nntp-open-connection): Fix the STARTTLS command syntax.
 
        * proto-stream.el (proto-stream-open-starttls): Actually implement the
index c41ddb3..905ad73 100644 (file)
 (require 'starttls)
 (require 'format-spec)
 
+(defcustom proto-stream-always-use-starttls t
+  "If non-nil, always try to upgrade network connections with STARTTLS."
+  :version "24.1"
+  :type 'boolean
+  :group 'comm)
+
 (declare-function gnutls-negotiate "gnutls"
                  (proc type &optional priority-string trustfiles keyfiles))
 
@@ -113,7 +119,8 @@ command to switch on STARTTLS otherwise."
              (funcall (cadr (memq :starttls-function parameters))
                       capabilities)))
        (cond
-        ((not starttls-command)
+        ((or (not starttls-command)
+             (not proto-stream-always-use-starttls))
          ;; If this server doesn't support STARTTLS, but we have
          ;; requested it explicitly, then close the connection and
          ;; return nil.