Mercurial > hg > xemacs-beta
comparison lisp/w3/ssl.el @ 98:0d2f883870bc r20-1b1
Import from CVS: tag r20-1b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:13:56 +0200 |
parents | 8fc7fe29b841 |
children | e04119814345 |
comparison
equal
deleted
inserted
replaced
97:498bf5da1c90 | 98:0d2f883870bc |
---|---|
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the | 24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the |
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
26 ;;; Boston, MA 02111-1307, USA. | 26 ;;; Boston, MA 02111-1307, USA. |
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
28 | 28 |
29 (defvar ssl-program-name "ssl %s %s" | 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 This is run through `format' with two strings, the hostname and port # | 31 |
32 to connect to.") | 32 (defvar ssl-program-arguments nil |
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 | |
35 specify any behaviour (certificate file locations, etc).") | |
33 | 36 |
34 (defun open-ssl-stream (name buffer host service) | 37 (defun open-ssl-stream (name buffer host service) |
35 "Open a SSL connection for a service to a host. | 38 "Open a SSL connection for a service to a host. |
36 Returns a subprocess-object to represent the connection. | 39 Returns a subprocess-object to represent the connection. |
37 Input and output work as for subprocesses; `delete-process' closes it. | 40 Input and output work as for subprocesses; `delete-process' closes it. |
43 BUFFER may be also nil, meaning that this process is not associated | 46 BUFFER may be also nil, meaning that this process is not associated |
44 with any buffer | 47 with any buffer |
45 Third arg is name of the host to connect to, or its IP address. | 48 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 | 49 Fourth arg SERVICE is name of the service desired, or an integer |
47 specifying a port number to connect to." | 50 specifying a port number to connect to." |
48 (let ((proc (start-process name buffer | 51 (let ((proc (apply 'start-process |
49 "/bin/sh" | 52 name |
50 "-c" | 53 buffer |
51 (format ssl-program-name host | 54 ssl-program-name |
52 (if (stringp service) | 55 (append ssl-program-arguments |
53 service | 56 (list host |
54 (int-to-string service)))))) | 57 (if (stringp service) |
58 service | |
59 (int-to-string service))))))) | |
55 (process-kill-without-query proc) | 60 (process-kill-without-query proc) |
56 proc)) | 61 proc)) |
57 | 62 |
58 (provide 'ssl) | 63 (provide 'ssl) |