Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable checking hostname when tls verify is false #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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