Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2163

Improve diagnostics of PyOpenSSL connection errors

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.11
    • Affects Version/s: None
    • Component/s: None

      When the handshake fails with stdlib ssl, we raise this error:

        File "/home/travis/build/mongodb/mongo-python-driver/pymongo/topology.py", line 209, in _select_servers_loop
          raise ServerSelectionTimeoutError(
      pymongo.errors.ServerSelectionTimeoutError: SSL handshake failed: localhost:27017: EOF occurred in violation of protocol (_ssl.c:1108)
      

      When the handshake fails with pyopenssl, we raise this terse error:

        File "/Users/shane/git/mongo-python-driver/pymongo/topology.py", line 210, in _select_servers_loop
          self._error_message(selector))
      pymongo.errors.ServerSelectionTimeoutError: (-1, 'Unexpected EOF')
      

      1) We should add suppress_ragged_eofs support to our pyopenssl connection wrapper to better match the errors we get from the stdlib.
      2) We should catch pyopenssl handshake errors when wrapping a socket and provide a more detailed error message.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: