sequences."
:type '(boolean))
+(defcustom elpher-TLS-cert-checks nil
+ "If non-nil, verify server TLS certificates using the default
+emacs security protocol. Otherwise, certificate verification is disabled.
+
+This defaults to off because it is standard practice for Gemini servers
+to use self-signed certificates, meaning that most servers provide what
+emacs considers to be an invalid certificate. Since non-Gemini uses such
+as gophers:// are essentially edge cases that rarely occur in the wild,
+this setting applies to *all* TLS connections made by Elpher."
+ :type '(boolean))
+
;;; Model
;;
(list 'with-current-buffer "*elpher*"
'(elpher-mode)
(append (list 'let '((inhibit-read-only t))
+ '(unless elpher-TLS-cert-checks
+ (setq-local network-security-level 'low))
'(erase-buffer)
'(elpher-update-header))
args)))
(let* ((kill-buffer-query-functions nil)
(port (elpher-address-port address))
(host (elpher-address-host address))
- (selector-string "")
+ (selector-string-parts nil)
(proc (open-network-stream "elpher-process"
nil
(if force-ipv4 (dns-query host) host)
(set-process-filter proc
(lambda (_proc string)
(cancel-timer timer)
- (setq selector-string
- (concat selector-string string))))
+ (setq selector-string-parts
+ (cons string selector-string-parts))))
(set-process-sentinel proc
(lambda (_proc event)
(condition-case the-error
"\r\n"))))
(t
(cancel-timer timer)
- (funcall renderer selector-string)
+ (funcall renderer (apply #'concat
+ (reverse selector-string-parts)))
(elpher-restore-pos)))
(error
(elpher-network-error address the-error))))))
(port (let ((given-port (elpher-address-port address)))
(if (> given-port 0) given-port 79)))
(host (elpher-address-host address))
- (selector-string "")
+ (selector-string-parts nil)
(proc (open-network-stream "elpher-process"
nil
(if force-ipv4 (dns-query host) host)
(set-process-filter proc
(lambda (_proc string)
(cancel-timer timer)
- (setq selector-string
- (concat selector-string string))))
+ (setq selector-string-parts
+ (cons string selector-string-parts))))
(set-process-sentinel proc
(lambda (_proc event)
(condition-case the-error
(concat user "\r\n"))))
(t
(cancel-timer timer)
- (funcall renderer selector-string)
+ (funcall renderer (apply #'concat
+ (reverse selector-string-parts)))
(elpher-restore-pos)))))))
(error
(elpher-network-error address the-error))))))