Skip to content

Commit

Permalink
check whether curl can use https or not.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-start-http-session): check if
curl can use https or not.
  • Loading branch information
hayamiz committed Dec 29, 2009
1 parent 120cd58 commit b7030c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2009-12-29 Yuto Hayamizu <y.hayamizu@gmail.com>

* twittering-mode.el (twittering-start-http-session): check if
curl can use https or not.

2009-12-29 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-get-response-body): Return nil
Expand Down
22 changes: 16 additions & 6 deletions twittering-mode.el
Expand Up @@ -582,12 +582,22 @@ PARAMETERS: http request parameters (query string)
headers)))

(let ((curl-program (twittering-find-curl-program)))
(if (and (not curl-program) twittering-use-ssl)
(if (yes-or-no-p "HTTPS(SSL) is not available. Use HTTP instead?")
(progn (setq twittering-use-ssl nil)
(twittering-update-mode-line))
(message "Request canceled")
(return)))
(when twittering-use-ssl
(cond
((not curl-program)
(if (yes-or-no-p "HTTPS(SSL) is not available because 'cURL' does not exist. Use HTTP instead?")
(progn (setq twittering-use-ssl nil)
(twittering-update-mode-line))
(message "Request canceled")
(return)))
((not (string-match "^Protocols: .*https"
(shell-command-to-string
(concat curl-program " --version"))))
(if (yes-or-no-p "HTTPS(SSL) is not available because your 'cURL' cannot use HTTPS. Use HTTP instead?")
(progn (setq twittering-use-ssl nil)
(twittering-update-mode-line))
(message "Request canceled")
(return)))))

(if twittering-use-ssl
(twittering-start-http-ssl-session
Expand Down

0 comments on commit b7030c9

Please sign in to comment.