diff options
| author | Simon Josefsson | 2004-10-12 09:55:08 +0000 |
|---|---|---|
| committer | Simon Josefsson | 2004-10-12 09:55:08 +0000 |
| commit | 5bbb0eb9eaf5304206dbbe39c0b35f756cd77482 (patch) | |
| tree | 70a9a0c68d8f637e03b6c6d8c335b94f413f1dbd /lisp/url/url-https.el | |
| parent | 18965008d19ace53d4adea3eec5ea1168a7e3942 (diff) | |
| download | emacs-5bbb0eb9eaf5304206dbbe39c0b35f756cd77482.tar.gz emacs-5bbb0eb9eaf5304206dbbe39c0b35f756cd77482.zip | |
url-vars.el (url-gateway-method): Add new method `tls'.
url-news.el (url-snews): Use nntp-open-tls-stream if
url-gateway-method is tls.
url-ldap.el (url-ldap-certificate-formatter): Use
tls-certificate-information if ssl.el is not available.
url-https.el (url-https-create-secure-wrapper): Use tls if ssl
is not available.
url-gw.el (url-open-stream): Support tls url-gateway-method.
(url-open-stream): Likewise.
Diffstat (limited to 'lisp/url/url-https.el')
| -rw-r--r-- | lisp/url/url-https.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/url/url-https.el b/lisp/url/url-https.el index 11b2593ea80..9631aeb18e4 100644 --- a/lisp/url/url-https.el +++ b/lisp/url/url-https.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; url-https.el --- HTTP over SSL routines | 1 | ;;; url-https.el --- HTTP over SSL/TLS routines |
| 2 | 2 | ||
| 3 | ;; Copyright (c) 1999, 2004 Free Software Foundation, Inc. | 3 | ;; Copyright (c) 1999, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -30,6 +30,7 @@ | |||
| 30 | (require 'url-parse) | 30 | (require 'url-parse) |
| 31 | (require 'url-cookie) | 31 | (require 'url-cookie) |
| 32 | (require 'url-http) | 32 | (require 'url-http) |
| 33 | (require 'tls) | ||
| 33 | 34 | ||
| 34 | (defconst url-https-default-port 443 "Default HTTPS port.") | 35 | (defconst url-https-default-port 443 "Default HTTPS port.") |
| 35 | (defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") | 36 | (defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") |
| @@ -38,12 +39,11 @@ | |||
| 38 | (defmacro url-https-create-secure-wrapper (method args) | 39 | (defmacro url-https-create-secure-wrapper (method args) |
| 39 | `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args | 40 | `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args |
| 40 | ,(format "HTTPS wrapper around `%s' call." (or method "url-http")) | 41 | ,(format "HTTPS wrapper around `%s' call." (or method "url-http")) |
| 41 | (condition-case () | 42 | (let ((url-gateway-method (condition-case () |
| 42 | (require 'ssl) | 43 | (require 'ssl) |
| 43 | (error | 44 | (error 'tls)))) |
| 44 | (error "HTTPS support could not find `ssl' library"))) | 45 | (,(intern (format (if method "url-http-%s" "url-http") method)) |
| 45 | (let ((url-gateway-method 'ssl)) | 46 | ,@(remove '&rest (remove '&optional args)))))) |
| 46 | ( ,(intern (format (if method "url-http-%s" "url-http") method)) ,@(remove '&rest (remove '&optional args)))))) | ||
| 47 | 47 | ||
| 48 | (url-https-create-secure-wrapper nil (url callback cbargs)) | 48 | (url-https-create-secure-wrapper nil (url callback cbargs)) |
| 49 | (url-https-create-secure-wrapper file-exists-p (url)) | 49 | (url-https-create-secure-wrapper file-exists-p (url)) |