adds workaround for circe TLS connections (#1862)

- OpenSSL versions > 1.1.0 break the assumptions of tls.el of where the
info block stops
- this makes circe hang on TLS connections (jorgenschaefer/circe#340)
- tls.el is no longer maintained therefore this adds a
workaround in circe-mode buffers
This commit is contained in:
Hanno Perrey 2020-03-15 17:32:32 +01:00
parent 4b20c7206e
commit a64a893fa0

View file

@ -94,6 +94,23 @@ playback.")
(add-hook 'circe-channel-mode-hook #'turn-on-visual-line-mode) (add-hook 'circe-channel-mode-hook #'turn-on-visual-line-mode)
(add-hook 'circe-mode-hook #'+irc--add-circe-buffer-to-persp-h) (add-hook 'circe-mode-hook #'+irc--add-circe-buffer-to-persp-h)
(add-hook 'circe-mode-hook #'turn-off-smartparens-mode) (add-hook 'circe-mode-hook #'turn-off-smartparens-mode)
(add-hook 'circe-mode-hook (lambda () (setq-local tls-end-of-info
(concat
"\\("
;; `openssl s_client' regexp. See ssl/ssl_txt.c lines 219-220.
;; According to apps/s_client.c line 1515 `---' is always the last
;; line that is printed by s_client before the real data.
"^ Verify return code: .+\n\\(\\|^ Extended master secret: .+\n\\)\\(\\|^ Max Early Data: .+\n\\)---\n\\|"
;; `gnutls' regexp. See src/cli.c lines 721-.
"^- Simple Client Mode:\n"
"\\(\n\\|" ; ignore blank lines
;; According to GnuTLS v2.1.5 src/cli.c lines 640-650 and 705-715
;; in `main' the handshake will start after this message. If the
;; handshake fails, the programs will abort.
"^\\*\\*\\* Starting TLS handshake\n\\)*"
"\\)")
)))
(defadvice! +irc--circe-run-disconnect-hook-a (&rest _) (defadvice! +irc--circe-run-disconnect-hook-a (&rest _)
"Runs `+irc-disconnect-hook' after circe disconnects." "Runs `+irc-disconnect-hook' after circe disconnects."