Skip to content

Conversation

@sivachandran
Copy link

@sivachandran sivachandran commented May 10, 2022

Closes #40

Not setting check_hostname to False when tls_verify is False triggers the following exception. The PR contains changes to disable hostname checking when tls verification is disabled.

...
File ".../lib/python3.8/site-packages/rfc5424logging/handler.py", line 229, in __init__
    self._setup_transport()
  File ".../lib/python3.8/site-packages/rfc5424logging/handler.py", line 239, in _setup_transport
    self.transport = transport.TLSSocketTransport(
  File ".../lib/python3.8/site-packages/rfc5424logging/transport.py", line 86, in __init__
    super(TLSSocketTransport, self).__init__(address, timeout, framing=framing)
  File ".../lib/python3.8/site-packages/rfc5424logging/transport.py", line 26, in __init__
    self.open()
  File ".../lib/python3.8/site-packages/rfc5424logging/transport.py", line 94, in open
    context.verify_mode = ssl.CERT_REQUIRED if self.tls_verify else ssl.CERT_NONE
  File "/usr/lib/python3.8/ssl.py", line 720, in verify_mode
    super(SSLContext, SSLContext).verify_mode.__set__(self, value)
ValueError: Cannot set verify_mode to CERT_NONE when check_hostname is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception raised when tls_verify is False

2 participants