Improve diagnostics of PyOpenSSL connection errors

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: