From 3d2924d275b01abe50a0bdd4764cb9ae0f93f913 Mon Sep 17 00:00:00 2001 From: Dave Voutila Date: Wed, 12 Jul 2023 15:35:03 -0400 Subject: [PATCH] Strip trailing dot off hostname. --- kafka/conn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/conn.py b/kafka/conn.py index cac354875..8c48a4e17 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -496,7 +496,7 @@ def _wrap_ssl(self): try: self._sock = self._ssl_context.wrap_socket( self._sock, - server_hostname=self.host, + server_hostname=self.host.rstrip("."), do_handshake_on_connect=False) except ssl.SSLError as e: log.exception('%s: Failed to wrap socket in SSLContext!', self)