From f1ae797577ccdc3620fd88b5929de66bd37d6bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Thu, 1 Oct 2020 12:42:34 +0200 Subject: [PATCH] Enable SNI for SSL auth to fix DirectTLS connection with some XMPP servers --- CHANGELOG.md | 3 ++- VERSION | 2 +- linker.php | 13 ++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ffa9aebc..6bcf9e7e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ Movim Changelog ================ -v0.19 (trunk) +v0.18.1 (trunk) --------------------------- + * Enable SNI for SSL auth to fix DirectTLS connection with some XMPP servers v0.18 --------------------------- diff --git a/VERSION b/VERSION index d314dc431..67a24141d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.18 +v0.18.1rc0 diff --git a/linker.php b/linker.php index 39dfddb3a..29e0d786d 100644 --- a/linker.php +++ b/linker.php @@ -46,14 +46,7 @@ function handleSSLErrors($errno, $errstr) { - fwrite( - STDERR, - colorize(getenv('sid'), 'yellow'). - " : ".colorize($errno, 'red'). - " ". - colorize($errstr, 'red'). - "\n" - ); + logOut(colorize('SSL Error '.$errno.': '.$errstr, 'red')); } // Temporary linker killer @@ -101,7 +94,7 @@ function enableEncryption($stream): bool $session = Session::start(); stream_set_blocking($stream, 1); - stream_context_set_option($stream, 'ssl', 'SNI_enabled', false); + stream_context_set_option($stream, 'ssl', 'SNI_enabled', true); stream_context_set_option($stream, 'ssl', 'peer_name', $session->get('host')); stream_context_set_option($stream, 'ssl', 'allow_self_signed', false); @@ -182,6 +175,8 @@ function shutdown() global $loop; global $wsSocket; + logOut(colorize('Shutdown', 'blue')); + $wsSocket->close(); $loop->stop(); }