comparison lisp/net/gnutls.el @ 110611:6c735824d0c1

Add gnutls logging and clean up various gnutls bits. From: Teodor Zlatanov <tzz@lifelogs.com>
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Mon, 27 Sep 2010 18:44:31 +0200
parents b4f4c3e9b976
children 256dd50b2a63
comparison
equal deleted inserted replaced
110610:f3646cf59e9f 110611:6c735824d0c1
29 ;; 29 ;;
30 ;; (setq jas (open-ssl-stream "ssl" (current-buffer) "www.pdc.kth.se" 443)) 30 ;; (setq jas (open-ssl-stream "ssl" (current-buffer) "www.pdc.kth.se" 443))
31 ;; (process-send-string jas "GET /\r\n\r\n") 31 ;; (process-send-string jas "GET /\r\n\r\n")
32 32
33 ;;; Code: 33 ;;; Code:
34
35 (defgroup gnutls nil
36 "Emacs interface to the GnuTLS library."
37 :prefix "gnutls-"
38 :group 'net-utils)
39
40 (defcustom gnutls-log-level 2
41 "Logging level to be used by `starttls-negotiate' and GnuTLS."
42 :type 'integer
43 :group 'gnutls)
34 44
35 (defun open-ssl-stream (name buffer host service) 45 (defun open-ssl-stream (name buffer host service)
36 "Open a SSL connection for a service to a host. 46 "Open a SSL connection for a service to a host.
37 Returns a subprocess-object to represent the connection. 47 Returns a subprocess-object to represent the connection.
38 Input and output work as for subprocesses; `delete-process' closes it. 48 Input and output work as for subprocesses; `delete-process' closes it.
70 ((eq credentials 'gnutls-x509pki) 80 ((eq credentials 'gnutls-x509pki)
71 "NORMAL")))) 81 "NORMAL"))))
72 ret) 82 ret)
73 83
74 (gnutls-message-maybe 84 (gnutls-message-maybe
75 (setq ret (gnutls-boot proc priority-string credentials credentials-file)) 85 (setq ret (gnutls-boot proc priority-string
86 credentials credentials-file
87 nil nil gnutls-log-level))
76 "boot: %s") 88 "boot: %s")
77 89
78 (when (gnutls-errorp ret) 90 (when (gnutls-errorp ret)
79 (error "Could not boot GnuTLS for this process")); 91 (error "Could not boot GnuTLS for this process"));
80 92