lang/rest: prompt for self-signed/invalid certs

This commit is contained in:
Henrik Lissner 2018-08-16 16:42:01 +02:00
parent ce9f03f310
commit d60296111e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -4,6 +4,14 @@
:mode ("\\.http\\'" . restclient-mode) :mode ("\\.http\\'" . restclient-mode)
:config :config
(set-popup-rule! "^\\*HTTP Response" :size 0.4 :quit 'other) (set-popup-rule! "^\\*HTTP Response" :size 0.4 :quit 'other)
;; Forces underlying SSL verification to prompt for self-signed or invalid
;; certs, rather than silently reject them.
(defun +rest*permit-self-signed-ssl (orig-fn &rest args)
(let (gnutls-verify-error tls-checktrust)
(apply orig-fn args)))
(advice-add #'restclient-http-do :around #'+rest*permit-self-signed-ssl)
(map! :mode restclient-mode (map! :mode restclient-mode
:n [M-return] 'restclient-http-send-current :n [M-return] 'restclient-http-send-current
:localleader :localleader