1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-29 19:48:19 +00:00

Make URL pass the TLS peer status to the caller

* lisp/url/url-http.el (url-http-parse-headers): Pass the GnuTLS
status of the connection to the caller.
This commit is contained in:
Lars Magne Ingebrigtsen 2014-12-09 03:59:48 +01:00
parent afa1d80fe0
commit d7e5255013
3 changed files with 18 additions and 2 deletions

View File

@ -328,6 +328,10 @@ a function.
to specify that we're running in a noninteractive context, and that
we should not be queried about things like TLS certificate validity.
*** If URL is used with a https connection, the first callback argument
plist will contain a :peer element that has the output of
`gnutls-peer-status' (if Emacs is built with GnuTLS support).
** Tramp
*** New connection method "nc", which allows to access dumb busyboxes.

View File

@ -1,3 +1,8 @@
2014-12-09 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-http.el (url-http-parse-headers): Pass the GnuTLS status of
the connection to the caller.
2014-12-08 Stefan Monnier <monnier@iro.umontreal.ca>
* url-http.el (url-http-activate-callback): Make debug more verbose.

View File

@ -25,7 +25,9 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
(eval-when-compile
(require 'cl-lib)
(require 'subr-x))
(defvar url-callback-arguments)
(defvar url-callback-function)
@ -492,7 +494,12 @@ should be shown to the user."
(url-http-mark-connection-as-free (url-host url-current-object)
(url-port url-current-object)
url-http-process)
;; Pass the certificate on to the caller.
(when (gnutls-available-p)
(when-let (status (gnutls-peer-status url-http-process))
(setcar url-callback-arguments
(plist-put (car url-callback-arguments)
:peer status))))
(if (or (not (boundp 'url-http-end-of-headers))
(not url-http-end-of-headers))
(error "Trying to parse headers in odd buffer: %s" (buffer-name)))