annotate lisp/w3/ssl.el @ 14:9ee227acff29 r19-15b90

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