comparison lisp/w3/ssl.el @ 32:e04119814345 r19-15b99

Import from CVS: tag r19-15b99
author cvs
date Mon, 13 Aug 2007 08:52:56 +0200
parents 8fc7fe29b841
children c53a95d3c46d
comparison
equal deleted inserted replaced
31:b9328a10c56c 32:e04119814345
1 ;;; ssl.el,v --- ssl functions for emacsen without them builtin 1 ;;; ssl.el,v --- ssl functions for emacsen without them builtin
2 ;; Author: wmperry 2 ;; Author: wmperry
3 ;; Created: 1996/05/28 01:20:06 3 ;; Created: 1997/03/09 23:02:56
4 ;; Version: 1.2 4 ;; Version: 1.8
5 ;; Keywords: comm 5 ;; Keywords: comm
6 6
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu) 8 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu)
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 28
29 (defvar ssl-program-name "ssl" 29 (defvar ssl-program-name "ssl"
30 "*The program to run in a subprocess to open an SSL connection.") 30 "*The program to run in a subprocess to open an SSL connection.")
31 31
32 (defvar ssl-program-arguments nil 32 (defvar ssl-program-arguments '(host port)
33 "*Arguments that should be passed to the program `ssl-program-name'. 33 "*Arguments that should be passed to the program `ssl-program-name'.
34 This should be used if your SSL program needs command line switches to 34 This should be used if your SSL program needs command line switches to
35 specify any behaviour (certificate file locations, etc).") 35 specify any behaviour (certificate file locations, etc).
36 The special symbols 'host and 'port may be used in the list of arguments
37 and will be replaced with the hostname and service/port that will be connected
38 to.")
36 39
37 (defun open-ssl-stream (name buffer host service) 40 (defun open-ssl-stream (name buffer host service)
38 "Open a SSL connection for a service to a host. 41 "Open a SSL connection for a service to a host.
39 Returns a subprocess-object to represent the connection. 42 Returns a subprocess-object to represent the connection.
40 Input and output work as for subprocesses; `delete-process' closes it. 43 Input and output work as for subprocesses; `delete-process' closes it.
45 an output stream or filter function to handle the output. 48 an output stream or filter function to handle the output.
46 BUFFER may be also nil, meaning that this process is not associated 49 BUFFER may be also nil, meaning that this process is not associated
47 with any buffer 50 with any buffer
48 Third arg is name of the host to connect to, or its IP address. 51 Third arg is name of the host to connect to, or its IP address.
49 Fourth arg SERVICE is name of the service desired, or an integer 52 Fourth arg SERVICE is name of the service desired, or an integer
50 specifying a port number to connect to." 53 specifying a port number to connect to."
51 (let ((proc (apply 'start-process 54 (if (integerp service) (setq service (int-to-string service)))
52 name 55 (let* ((process-connection-type t)
53 buffer 56 (port service)
54 ssl-program-name 57 (proc (eval
55 (append ssl-program-arguments 58 (`
56 (list host 59 (start-process name buffer ssl-program-name
57 (if (stringp service) 60 (,@ ssl-program-arguments))))))
58 service
59 (int-to-string service)))))))
60 (process-kill-without-query proc) 61 (process-kill-without-query proc)
61 proc)) 62 proc))
62 63
63 (provide 'ssl) 64 (provide 'ssl)