wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
65 stars 32 forks source link

Configuration needs to be set in SSLStreamServer error in ManInTheMiddle module #4142

Closed Rebits closed 7 months ago

Rebits commented 1 year ago

Description

During the Enrollment IT process, an intermittent error has been detected in the Man in the Middle's SSL listener. The error message is as follows:

  /usr/local/python-3.version/lib/python3.10/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-138 (serve_forever)

  Traceback (most recent call last):
    File "/usr/local/python-3.version/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
      self.run()
    File "/usr/local/python-3.version/lib/python3.10/threading.py", line 953, in run
      self._target(*self._args, **self._kwargs)
    File "/usr/local/python-3.version/lib/python3.10/socketserver.py", line 237, in serve_forever
      self._handle_request_noblock()
    File "/usr/local/python-3.version/lib/python3.10/socketserver.py", line 311, in _handle_request_noblock
      request, client_address = self.get_request()
    File "/usr/local/python-3.version/lib/python3.10/site-packages/wazuh_testing-4.4.0-py3.10.egg/wazuh_testing/tools/monitoring.py", line 578, in get_request
      raise Exception('SSL configuration needs to be set in SSLStreamServer')
  Exception: SSL configuration needs to be set in SSLStreamServer

    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

This exception is triggered under the following conditions:

        if not self.certfile or not self.keyfile or not self.ssl_version:

It is likely that a race condition exists, causing these errors to appear in rare cases.

Further investigation and research are required to identify the root cause of this error.

damarisg commented 7 months ago

We decided to close them.