14
|
1 ;;; ssl.el,v --- ssl functions for emacsen without them builtin
|
|
2 ;; Author: wmperry
|
|
3 ;; Created: 1996/05/28 01:20:06
|
|
4 ;; Version: 1.2
|
|
5 ;; Keywords: comm
|
|
6
|
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
8 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
|
|
9 ;;; Copyright (c) 1996 Free Software Foundation, Inc.
|
|
10 ;;;
|
|
11 ;;; This file is not part of GNU Emacs, but the same permissions apply.
|
|
12 ;;;
|
|
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
14 ;;; it under the terms of the GNU General Public License as published by
|
|
15 ;;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;;; any later version.
|
|
17 ;;;
|
|
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
|
|
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21 ;;; GNU General Public License for more details.
|
|
22 ;;;
|
|
23 ;;; You should have received a copy of the GNU General Public License
|
|
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;;; Boston, MA 02111-1307, USA.
|
|
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
28
|
|
29 (defvar ssl-program-name "ssl %s %s"
|
|
30 "*The program to run in a subprocess to open an SSL connection.
|
|
31 This is run through `format' with two strings, the hostname and port #
|
|
32 to connect to.")
|
|
33
|
|
34 (defun open-ssl-stream (name buffer host service)
|
|
35 "Open a SSL connection for a service to a host.
|
|
36 Returns a subprocess-object to represent the connection.
|
|
37 Input and output work as for subprocesses; `delete-process' closes it.
|
|
38 Args are NAME BUFFER HOST SERVICE.
|
|
39 NAME is name for process. It is modified if necessary to make it unique.
|
|
40 BUFFER is the buffer (or buffer-name) to associate with the process.
|
|
41 Process output goes at end of that buffer, unless you specify
|
|
42 an output stream or filter function to handle the output.
|
|
43 BUFFER may be also nil, meaning that this process is not associated
|
|
44 with any buffer
|
|
45 Third arg is name of the host to connect to, or its IP address.
|
|
46 Fourth arg SERVICE is name of the service desired, or an integer
|
|
47 specifying a port number to connect to."
|
|
48 (let ((proc (start-process name buffer
|
|
49 "/bin/sh"
|
|
50 "-c"
|
|
51 (format ssl-program-name host
|
|
52 (if (stringp service)
|
|
53 service
|
|
54 (int-to-string service))))))
|
|
55 (process-kill-without-query proc)
|
|
56 proc))
|
|
57
|
|
58 (provide 'ssl)
|