Index: tls.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/tls.el,v retrieving revision 7.5 diff -u -3 -b -r7.5 tls.el --- tls.el 13 Feb 2005 04:44:40 -0000 7.5 +++ tls.el 8 Apr 2005 00:33:31 -0000 @@ -78,6 +78,20 @@ :type 'regexp :group 'tls) +(defcustom tls-refused "connect: Connection refused" + "*Regular expression indicating connection refused +The default is what GNUTLS's \"gnutls-cli\" outputs." + :version "22.1" + :type 'regexp + :group 'tls) + +(defcustom tls-unresolvable "Cannot resolve " + "*Regular expression indicating unknown host name +The default is what GNUTLS's \"gnutls-cli\" outputs." + :version "22.1" + :type 'regexp + :group 'tls) + (defcustom tls-certtool-program (executable-find "certtool") "Name of GnuTLS certtool. Used by `tls-certificate-information'." @@ -138,11 +152,15 @@ service))))) response) (while (and process - (memq (process-status process) '(open run)) (save-excursion (set-buffer buffer) ;; XXX "blue moon" nntp.el bug (goto-char (point-min)) - (not (setq done (re-search-forward tls-success nil t))))) + (when (re-search-forward tls-unresolvable nil t) + (error "Cannot resolve `%s'" host)) + (when (re-search-forward tls-refused nil t) + (error "Connection to `%s' refused" host)) + (not (setq done (re-search-forward tls-success nil t)))) + (memq (process-status process) '(open run))) (accept-process-output process 1) (sit-for 1)) (message "Opening TLS connection with `%s'...%s" cmd @@ -152,6 +170,8 @@ (delete-process process)))) (message "Opening TLS connection to `%s'...%s" host (if done "done" "failed")) + (unless done + (error "Unknown error when connecting to `%s' -- is any `tls-program' installed?" host)) done)) (provide 'tls)