(require 'base64)
(eval-and-compile
- (autoload 'open-ssl-stream "ssl")
(autoload 'starttls-open-stream "starttls")
(autoload 'starttls-negotiate "starttls")
(autoload 'rfc2104-hash "rfc2104")
(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))
- (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)
- (when (setq process
- (condition-case nil
- (as-binary-process
- (open-ssl-stream name buffer server port))
- (error nil)))
+ (let ((port (or port imap-default-ssl-port))
+ (process-connection-type nil)
+ process)
+ (when (prog1
+ (setq process (as-binary-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))
(with-current-buffer buffer
(goto-char (point-min))
(while (and (memq (process-status process) '(open run))
(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
"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 (as-binary-process
+ (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]")
proc)
(and nntp-pre-command
(push nntp-pre-command command))
- (setq proc (apply 'start-process "nntpd" buffer command))
+ (setq proc (as-binary-process
+ (apply 'start-process "nntpd" buffer command)))
(save-excursion
(set-buffer buffer)
(nntp-wait-for-string "^\r*20[01]")
(case-fold-search t)
proc)
(and nntp-pre-command (push nntp-pre-command command))
- (setq proc (apply 'start-process "nntpd" buffer command))
+ (setq proc (as-binary-process
+ (apply 'start-process "nntpd" buffer command)))
(when (memq (process-status proc) '(open run))
(nntp-wait-for-string "^r?telnet")
(process-send-string proc "set escape \^X\n")