1 |
;;; url-https.el --- HTTP over SSL routines |
;;; url-https.el --- HTTP over SSL/TLS routines |
2 |
|
|
3 |
;; Copyright (c) 1999, 2004 Free Software Foundation, Inc. |
;; Copyright (c) 1999, 2004 Free Software Foundation, Inc. |
4 |
|
|
30 |
(require 'url-parse) |
(require 'url-parse) |
31 |
(require 'url-cookie) |
(require 'url-cookie) |
32 |
(require 'url-http) |
(require 'url-http) |
33 |
|
(require 'tls) |
34 |
|
|
35 |
(defconst url-https-default-port 443 "Default HTTPS port.") |
(defconst url-https-default-port 443 "Default HTTPS port.") |
36 |
(defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") |
(defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") |
39 |
(defmacro url-https-create-secure-wrapper (method args) |
(defmacro url-https-create-secure-wrapper (method args) |
40 |
`(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args |
`(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args |
41 |
,(format "HTTPS wrapper around `%s' call." (or method "url-http")) |
,(format "HTTPS wrapper around `%s' call." (or method "url-http")) |
42 |
(condition-case () |
(let ((url-gateway-method (condition-case () |
43 |
(require 'ssl) |
(require 'ssl) |
44 |
(error |
(error 'tls)))) |
45 |
(error "HTTPS support could not find `ssl' library"))) |
(,(intern (format (if method "url-http-%s" "url-http") method)) |
46 |
(let ((url-gateway-method 'ssl)) |
,@(remove '&rest (remove '&optional args)))))) |
|
( ,(intern (format (if method "url-http-%s" "url-http") method)) ,@(remove '&rest (remove '&optional args)))))) |
|
47 |
|
|
48 |
(url-https-create-secure-wrapper nil (url callback cbargs)) |
(url-https-create-secure-wrapper nil (url callback cbargs)) |
49 |
(url-https-create-secure-wrapper file-exists-p (url)) |
(url-https-create-secure-wrapper file-exists-p (url)) |