From a64a893fa0df6b65f7b21173b2883ca3824b193c Mon Sep 17 00:00:00 2001 From: Hanno Perrey Date: Sun, 15 Mar 2020 17:32:32 +0100 Subject: [PATCH 1/3] 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 --- modules/app/irc/config.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 38f910a0c..a9e1b08a6 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -94,6 +94,23 @@ playback.") (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 #'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 _) "Runs `+irc-disconnect-hook' after circe disconnects." From 4f39bf36f058b3e59068b5cb61cd810b05250813 Mon Sep 17 00:00:00 2001 From: Hanno Perrey Date: Sun, 15 Mar 2020 17:36:21 +0100 Subject: [PATCH 2/3] stops overriding circe default servers circe-network-defaults is filled with predefined server details e.g. for Freenode.net and those defaults should not be wiped here --- modules/app/irc/config.el | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index a9e1b08a6..2d2f109f0 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -48,7 +48,6 @@ playback.") (use-package! circe :commands circe circe-server-buffers - :init (setq circe-network-defaults nil) :config (setq circe-default-quit-message nil circe-default-part-message nil From 8648c9ad91f42b6eee249a950597cd3a2658c061 Mon Sep 17 00:00:00 2001 From: Hanno Perrey Date: Fri, 27 Mar 2020 09:50:35 +0100 Subject: [PATCH 3/3] syntactic and cosmetic changes --- modules/app/irc/config.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 2d2f109f0..5c1af4d17 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -93,7 +93,7 @@ playback.") (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 #'turn-off-smartparens-mode) - (add-hook 'circe-mode-hook (lambda () (setq-local tls-end-of-info + (setq-hook! 'circe-mode-hook tls-end-of-info (concat "\\(" ;; `openssl s_client' regexp. See ssl/ssl_txt.c lines 219-220. @@ -107,8 +107,7 @@ playback.") ;; 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 _)