annotate lisp/url/url-https.el @ 67365:6855b4b329e7

*** empty log message ***
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 07 Dec 2005 23:39:30 +0000
parents 875dcc490074
children e8a3fb527b77 532e0a9335a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57449
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
1 ;;; url-https.el --- HTTP over SSL/TLS routines
54933
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
2
64748
875dcc490074 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64084
diff changeset
3 ;; Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc.
54933
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
4
54695
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
5 ;; Keywords: comm, data, processes
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
6
54933
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
7 ;; This file is part of GNU Emacs.
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
8 ;;
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
12 ;; any later version.
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
13 ;;
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
17 ;; GNU General Public License for more details.
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
18 ;;
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
19 ;; You should have received a copy of the GNU General Public License
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64084
a8fa7c632ee4 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 57449
diff changeset
21 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
a8fa7c632ee4 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 57449
diff changeset
22 ;; Boston, MA 02110-1301, USA.
54933
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
23
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
24 ;;; Commentary:
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
25
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
26 ;;; Code:
54695
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
27
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
28 (require 'url-gw)
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
29 (require 'url-util)
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
30 (require 'url-parse)
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
31 (require 'url-cookie)
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
32 (require 'url-http)
57449
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
33 (require 'tls)
54695
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
34
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
35 (defconst url-https-default-port 443 "Default HTTPS port.")
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
36 (defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.")
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
37 (defalias 'url-https-expand-file-name 'url-http-expand-file-name)
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
38
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
39 (defmacro url-https-create-secure-wrapper (method args)
54798
faaf1fc90954 (url-https-create-secure-wrapper): Use modern backquotes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54770
diff changeset
40 `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args
faaf1fc90954 (url-https-create-secure-wrapper): Use modern backquotes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54770
diff changeset
41 ,(format "HTTPS wrapper around `%s' call." (or method "url-http"))
57449
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
42 (let ((url-gateway-method (condition-case ()
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
43 (require 'ssl)
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
44 (error 'tls))))
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
45 (,(intern (format (if method "url-http-%s" "url-http") method))
202c408c174b url-vars.el (url-gateway-method): Add new method `tls'.
Simon Josefsson <jas@extundo.com>
parents: 54933
diff changeset
46 ,@(remove '&rest (remove '&optional args))))))
54695
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
47
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
48 (url-https-create-secure-wrapper nil (url callback cbargs))
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
49 (url-https-create-secure-wrapper file-exists-p (url))
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
50 (url-https-create-secure-wrapper file-readable-p (url))
54933
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
51 (url-https-create-secure-wrapper file-attributes (url &optional id-format))
54695
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
52
3fb37923e567 Initial revision
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
diff changeset
53 (provide 'url-https)
54699
7784ae10206d Resolve CVS conflicts
Miles Bader <miles@gnu.org>
parents: 54695
diff changeset
54
54933
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
55 ;; arch-tag: c3645ac5-c248-4d12-ad41-7c4b6f7b6d19
1ebec6b5e54f (url-https-file-attributes): Add id-format param.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54798
diff changeset
56 ;;; url-https.el ends here