diff options
| author | Lars Magne Ingebrigtsen | 2014-12-09 04:21:12 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-12-09 04:21:12 +0100 |
| commit | 0cc8da5cd8f3a4d7c19501a018cf2a38f86c509b (patch) | |
| tree | 49066ed761db88d570b65b433c692fb1d3bf8a48 | |
| parent | d7e5255013e0d784865e03a1acb6d663c30f0907 (diff) | |
| download | emacs-0cc8da5cd8f3a4d7c19501a018cf2a38f86c509b.tar.gz emacs-0cc8da5cd8f3a4d7c19501a018cf2a38f86c509b.zip | |
Make the https logic in url-http work on redirects
(url-http-parse-headers): When being redirected, make sure we
flush the previous certificate.
| -rw-r--r-- | lisp/url/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/url/url-http.el | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index d544cf0d083..690f6991910 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * url-http.el (url-http-parse-headers): Pass the GnuTLS status of | 3 | * url-http.el (url-http-parse-headers): Pass the GnuTLS status of |
| 4 | the connection to the caller. | 4 | the connection to the caller. |
| 5 | (url-http-parse-headers): When being redirected, make sure we | ||
| 6 | flush the previous certificate. | ||
| 5 | 7 | ||
| 6 | 2014-12-08 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2014-12-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | 9 | ||
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index f5a214a89d8..34d325acf56 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el | |||
| @@ -494,12 +494,14 @@ should be shown to the user." | |||
| 494 | (url-http-mark-connection-as-free (url-host url-current-object) | 494 | (url-http-mark-connection-as-free (url-host url-current-object) |
| 495 | (url-port url-current-object) | 495 | (url-port url-current-object) |
| 496 | url-http-process) | 496 | url-http-process) |
| 497 | ;; Pass the certificate on to the caller. | 497 | ;; Pass the https certificate on to the caller. |
| 498 | (when (gnutls-available-p) | 498 | (when (gnutls-available-p) |
| 499 | (when-let (status (gnutls-peer-status url-http-process)) | 499 | (let ((status (gnutls-peer-status url-http-process))) |
| 500 | (setcar url-callback-arguments | 500 | (when (or status |
| 501 | (plist-put (car url-callback-arguments) | 501 | (plist-get (car url-callback-arguments) :peer)) |
| 502 | :peer status)))) | 502 | (setcar url-callback-arguments |
| 503 | (plist-put (car url-callback-arguments) | ||
| 504 | :peer status))))) | ||
| 503 | (if (or (not (boundp 'url-http-end-of-headers)) | 505 | (if (or (not (boundp 'url-http-end-of-headers)) |
| 504 | (not url-http-end-of-headers)) | 506 | (not url-http-end-of-headers)) |
| 505 | (error "Trying to parse headers in odd buffer: %s" (buffer-name))) | 507 | (error "Trying to parse headers in odd buffer: %s" (buffer-name))) |