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

Improve diagnostics of PyOpenSSL connection errors

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.11
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: