From 7287e0a0ef473ee6a7692699dea0a4f274590b53 Mon Sep 17 00:00:00 2001 From: Gerald Lau Date: Tue, 5 Jul 2022 10:02:10 +0800 Subject: [PATCH] fix: disable checking hostname when tls verify is false https://github.com/jobec/rfc5424-logging-handler/pull/39 --- rfc5424logging/transport.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rfc5424logging/transport.py b/rfc5424logging/transport.py index a7f3fdc..30eb107 100644 --- a/rfc5424logging/transport.py +++ b/rfc5424logging/transport.py @@ -90,6 +90,9 @@ def open(self): context = ssl.create_default_context( purpose=ssl.Purpose.SERVER_AUTH, cafile=self.tls_ca_bundle ) + # copied from https://github.com/jobec/rfc5424-logging-handler/pull/39 + # if/when this PR gets merged we should use the pypi provided rfc5424-logging-handler package + context.check_hostname = self.tls_verify context.verify_mode = ssl.CERT_REQUIRED if self.tls_verify else ssl.CERT_NONE server_hostname, _ = self.address if self.tls_client_cert: