aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-12-05 19:12:22 +0000
committerDave Love2000-12-05 19:12:22 +0000
commit10b7b8fc111f93e37d19a1558afa7530e85e8329 (patch)
treee0a6763e1e7ca7695ef3b70e02a87948c255610b
parent52be17cc7111b281eceb17aae0c0adad307d51c9 (diff)
downloademacs-10b7b8fc111f93e37d19a1558afa7530e85e8329.tar.gz
emacs-10b7b8fc111f93e37d19a1558afa7530e85e8329.zip
*** empty log message ***
-rw-r--r--lisp/gnus/starttls.el74
1 files changed, 74 insertions, 0 deletions
diff --git a/lisp/gnus/starttls.el b/lisp/gnus/starttls.el
new file mode 100644
index 00000000000..1875dcbe43d
--- /dev/null
+++ b/lisp/gnus/starttls.el
@@ -0,0 +1,74 @@
1;;; starttls.el --- STARTTLS functions
2
3;; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4
5;; Author: Daiki Ueno <ueno@unixuser.org>
6;; Created: 1999/11/20
7;; Keywords: TLS, SSL, OpenSSL
8
9;; This file is not part of any package.
10
11;; This program is free software; you can redistribute it and/or
12;; modify it under the terms of the GNU General Public License as
13;; published by the Free Software Foundation; either version 2, or (at
14;; your option) any later version.
15
16;; This program is distributed in the hope that it will be useful, but
17;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19;; General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA.
25
26;;; Commentary:
27
28;; This module defines some utility functions for STARTTLS profiles.
29
30;; [RFC 2595] "Using TLS with IMAP, POP3 and ACAP"
31;; by Chris Newman <chris.newman@innosoft.com> (1999/06)
32
33;;; Code:
34
35(defgroup starttls nil
36 "Support for `Transport Layer Security' protocol."
37 :group 'ssl)
38
39(defcustom starttls-program "starttls"
40 "The program to run in a subprocess to open an TLSv1 connection."
41 :group 'starttls)
42
43(defcustom starttls-extra-args nil
44 "Extra arguments to `starttls-program'"
45 :group 'starttls)
46
47(defun starttls-negotiate (process)
48 (signal-process (process-id process) 'SIGALRM))
49
50(defun starttls-open-stream (name buffer host service)
51 "Open a TLS connection for a service to a host.
52Returns a subprocess-object to represent the connection.
53Input and output work as for subprocesses; `delete-process' closes it.
54Args are NAME BUFFER HOST SERVICE.
55NAME is name for process. It is modified if necessary to make it unique.
56BUFFER is the buffer (or `buffer-name') to associate with the process.
57 Process output goes at end of that buffer, unless you specify
58 an output stream or filter function to handle the output.
59 BUFFER may be also nil, meaning that this process is not associated
60 with any buffer
61Third arg is name of the host to connect to, or its IP address.
62Fourth arg SERVICE is name of the service desired, or an integer
63specifying a port number to connect to."
64 (let* ((process-connection-type nil)
65 (process (apply #'start-process
66 name buffer starttls-program
67 host (format "%s" service)
68 starttls-extra-args)))
69 (process-kill-without-query process)
70 process))
71
72(provide 'starttls)
73
74;;; starttls.el ends here