If we don't have gnutls-cli or gnutls built in, then don't try to establish a STARTTL...
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 27 Nov 2010 15:57:33 +0000 (16:57 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 27 Nov 2010 15:57:33 +0000 (16:57 +0100)
lisp/ChangeLog
lisp/proto-stream.el

index 9a4f10e..ed88190 100644 (file)
@@ -2,6 +2,8 @@
 
        * proto-stream.el (proto-stream-open-tls): Delete output from openssl
        if we're using tls.el.
+       (proto-stream-open-network): If we don't have gnutls-cli or gnutls
+       built in, then don't try to establish a STARTTLS connection.
 
        * nntp.el (nntp-open-connection): Switch on STARTTLS on supported
        servers.
index de9875f..0b4e30c 100644 (file)
@@ -134,9 +134,14 @@ command to switch on STARTTLS otherwise."
          (process-send-string stream capability-command)
          (list stream greeting (proto-stream-get-response
                                 stream start (proto-stream-eoc parameters))))
-        (t
+        ((executable-find "gnutls-cli")
+         (delete-process stream)
+         (proto-stream-open-starttls name buffer host service parameters))
+        ((eq (cadr (memq :type parameters)) 'starttls)
          (delete-process stream)
-         (proto-stream-open-starttls name buffer host service parameters)))))))
+         nil)
+        (t
+         (list stream greeting capabilities)))))))
 
 (defun proto-stream-capabilities (stream command end-of-command)
   (let ((start (with-current-buffer (process-buffer stream) (point-max))))