* imap.el (imap-ssl-open): Don't depend on ssl.el.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 28 Feb 2003 00:09:51 +0000 (00:09 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Fri, 28 Feb 2003 00:09:51 +0000 (00:09 +0000)
* nntp.el (nntp-open-ssl-stream): Don't depend on ssl.el.

lisp/ChangeLog
lisp/imap.el
lisp/nntp.el

index 290651b..137148f 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * imap.el (imap-ssl-open): Don't depend on ssl.el.
+       * nntp.el (nntp-open-ssl-stream): Don't depend on ssl.el.
+
 2003-02-26  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * spam.el: add spam-stat-load to gnus-get-new-news-hook
index aa26b06..37a913e 100644 (file)
 
 (eval-when-compile (require 'cl))
 (eval-and-compile
-  (autoload 'open-ssl-stream "ssl")
   (autoload 'base64-decode-string "base64")
   (autoload 'base64-encode-string "base64")
   (autoload 'starttls-open-stream "starttls")
@@ -601,24 +600,23 @@ If ARGS, PROMPT is used as an argument to `format'."
   (let ((cmds (if (listp imap-ssl-program) imap-ssl-program
                (list imap-ssl-program)))
        cmd done)
-    (condition-case ()
-       (require 'ssl)
-      (error))
     (while (and (not done) (setq cmd (pop cmds)))
       (message "imap: Opening SSL connection with `%s'..." cmd)
       (let* ((port (or port imap-default-ssl-port))
             (coding-system-for-read imap-coding-system-for-read)
             (coding-system-for-write imap-coding-system-for-write)
-            (ssl-program-name shell-file-name)
-            (ssl-program-arguments
-             (list shell-command-switch
-                   (format-spec cmd (format-spec-make
-                                     ?s server
-                                     ?p (number-to-string port)))))
+            (process-connection-type nil)
             process)
-       (when (setq process (condition-case ()
-                               (open-ssl-stream name buffer server port)
-                             (error)))
+       (when (progn
+               (setq process (start-process 
+                              name buffer shell-file-name
+                              shell-command-switch
+                              (format-spec cmd 
+                                           (format-spec-make
+                                            ?s server
+                                            ?p (number-to-string port)))))
+               (process-kill-without-query process)
+               process)
          (with-current-buffer buffer
            (goto-char (point-min))
            (while (and (memq (process-status process) '(open run))
index 30167c8..45e63a6 100644 (file)
@@ -254,9 +254,15 @@ noticing asynchronous data.")
 (defvar nntp-async-timer nil)
 (defvar nntp-async-process-list nil)
 
+(defvar nntp-ssl-program 
+  "openssl s_client -quiet -ssl3 -connect %s:%p"
+"A string containing commands for SSL connections.
+Within a string, %s is replaced with the server address and %p with
+port number on server.  The program should accept IMAP commands on
+stdin and return responses to stdout.")
+
 (eval-and-compile
-  (autoload 'mail-source-read-passwd "mail-source")
-  (autoload 'open-ssl-stream "ssl"))
+  (autoload 'mail-source-read-passwd "mail-source"))
 
 \f
 
@@ -1148,7 +1154,15 @@ password contained in '~/.nntp-authinfo'."
   (open-network-stream "nntpd" buffer nntp-address nntp-port-number))
 
 (defun nntp-open-ssl-stream (buffer)
-  (let ((proc (open-ssl-stream "nntpd" buffer nntp-address nntp-port-number)))
+  (let* ((process-connection-type nil)
+        (proc (start-process "nntpd" buffer 
+                             shell-file-name
+                             shell-command-switch
+                             (format-spec nntp-ssl-program 
+                                          (format-spec-make
+                                           ?s nntp-address
+                                           ?p nntp-port-number)))))
+    (process-kill-without-query proc)
     (save-excursion
       (set-buffer buffer)
       (nntp-wait-for-string "^\r*20[01]")