Move doom/am-i-secure to autoload/debug

This commit is contained in:
Henrik Lissner 2017-05-26 11:17:19 +02:00
parent 41a288d21d
commit 8615bf23ca
2 changed files with 23 additions and 23 deletions

View file

@ -31,3 +31,25 @@ selection of all minor-modes, active or not."
(list (completing-read "Minor mode: "
(doom-active-minor-modes))))
(describe-minor-mode-from-symbol (intern mode)))
;;;###autoload
(defun doom/am-i-secure ()
"Test to see if your root certificates are securely configured in emacs."
(declare (interactive-only t))
(interactive)
(if-let (bad-hosts
(loop for bad
in `("https://wrong.host.badssl.com/"
"https://self-signed.badssl.com/")
if (condition-case e
(url-retrieve bad (lambda (retrieved) t))
(error nil))
collect bad))
(error (format "tls seems to be misconfigured (it got %s)."
bad-hosts))
(url-retrieve "https://badssl.com"
(lambda (status)
(if (or (not status) (plist-member status :error))
(warn "Something went wrong.\n\n%s" (pp-to-string status))
(message "Your trust roots are set up properly.\n\n%s" (pp-to-string status))
t)))))