Permalink
Browse files

(twittering-delete-ca-cert-file): new defun.

(twittering-ensure-ca-cert): add it as a hook into 'kill-emacs-hook'.
  • Loading branch information...
1 parent f295b0e commit 7b397c3295d98839a4d07bf3fda10b5e28d50cbd @yata yata committed Feb 19, 2010
Showing with 15 additions and 1 deletion.
  1. +6 −0 ChangeLog
  2. +9 −1 twittering-mode.el
View
@@ -1,3 +1,9 @@
+2010-02-19 Satoshi Yatagawa <yata_github@y.hauN.org>
+
+ * twittering-mode.el (twittering-delete-ca-cert-file): New defun.
+ (twittering-ensure-ca-cert): Add it as a hook into
+ `kill-emacs-hook'.
+
2010-02-19 Tadashi MATSUO <tad@mymail.twin.jp>
* twittering-mode.el (twittering-set-window-end): use
View
@@ -1452,8 +1452,15 @@ PARAMETERS: http request parameters (query string)
method headers host port path parameters
noninteractive sentinel)))))
-;;; FIXME: file name is hard-coded. More robust way is desired.
(defvar twittering-cert-file nil)
+
+(defun twittering-delete-ca-cert-file ()
+ (when (and twittering-cert-file
+ (file-exists-p twittering-cert-file))
+ (delete-file twittering-cert-file)
+ (setq twittering-cert-file nil)))
+
+;;; FIXME: file name is hard-coded. More robust way is desired.
(defun twittering-ensure-ca-cert ()
"Create a CA certificate file if it does not exist, and return
its file name."
@@ -1477,6 +1484,7 @@ A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA
Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV
-----END CERTIFICATE-----"))
+ (add-hook 'kill-emacs-hook 'twittering-delete-ca-cert-file)
(setq twittering-cert-file file-name))))
(defun twittering-start-http-ssl-session (curl-program method headers host port path parameters &optional noninteractive sentinel)

0 comments on commit 7b397c3

Please sign in to comment.