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

OCSP tests fail with Python 3.4

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

      The last time they passed in CI was April 30. All other python (and pypy) versions are fine.

      The first failure was on May 10. CI backtracking show the tests failing with every commit after https://github.com/mongodb/mongo-python-driver/commit/bac6761a4304d48298e076a37c649d80619be6aa. The next commit doesn't seem like it could have any affect on these tests. The only package dependencies that seemed to change were transient dependencies:

      • six changed from 1.15.0 to 1.16.0
      • attrs changed from 20.3.0 to 21.1.0

      The last version of attrs that claims support for Python 3.4 is 19.3.0.

      With successful tests we get log output like:

       [2021/05/04 01:06:55.947] + OCSP_TLS_SHOULD_SUCCEED=false CA_FILE=/data/mci/3d9f0b36bd7fcc1ef75367e1ca7e96f7/drivers-tools/.evergreen/ocsp/ecdsa/ca.pem python test/ocsp/test_ocsp.py
       [2021/05/04 01:06:56.422] .2021-05-04 01:06:56,422 DEBUG ocsp_support Peer did not staple an OCSP response
       [2021/05/04 01:06:56.423] 2021-05-04 01:06:56,422 DEBUG ocsp_support Requesting OCSP data
       [2021/05/04 01:06:56.423] 2021-05-04 01:06:56,422 DEBUG ocsp_support Trying http://localhost:9001/power/level
       [2021/05/04 01:06:56.426] 2021-05-04 01:06:56,426 DEBUG connectionpool Starting new HTTP connection (1): localhost:9001
       [2021/05/04 01:06:56.426] 2021-05-04 01:06:56,426 DEBUG ocsp_support HTTP request failed: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /power/level (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa223f9cc50>: Failed to establish a new connection: [Errno 111] Connection refused',))
       [2021/05/04 01:06:56.428] 2021-05-04 01:06:56,426 DEBUG ocsp_support Trying http://localhost:8100/status
       [2021/05/04 01:06:56.428] 2021-05-04 01:06:56,428 DEBUG connectionpool Starting new HTTP connection (1): localhost:8100
       [2021/05/04 01:06:56.436] INFO:werkzeug:127.0.0.1 - - [04/May/2021 01:06:56] "POST /status HTTP/1.1" 200 -
       [2021/05/04 01:06:56.437] 2021-05-04 01:06:56,437 DEBUG connectionpool http://localhost:8100 "POST /status HTTP/1.1" 200 1049
       [2021/05/04 01:06:56.438] 2021-05-04 01:06:56,438 DEBUG ocsp_support OCSP response status: <OCSPResponseStatus.SUCCESSFUL: 0>
       [2021/05/04 01:06:56.438] 2021-05-04 01:06:56,438 DEBUG ocsp_support Verifying response
       [2021/05/04 01:06:56.438] 2021-05-04 01:06:56,438 DEBUG ocsp_support Responder is a delegate
       [2021/05/04 01:06:56.442] 2021-05-04 01:06:56,439 DEBUG ocsp_support Using key hash
       [2021/05/04 01:06:56.442] 2021-05-04 01:06:56,442 DEBUG ocsp_support Caching OCSP response.
       [2021/05/04 01:06:56.443] 2021-05-04 01:06:56,442 DEBUG ocsp_support OCSP cert status: <OCSPCertStatus.REVOKED: 1>
       [2021/05/04 01:06:56.956] ..
       [2021/05/04 01:06:56.956] ----------------------------------------------------------------------
       [2021/05/04 01:06:56.956] Ran 3 tests in 0.551s
       [2021/05/04 01:06:56.956] OK
      

      Failing tests provide no such log output. I suspect there is an import failure happening in the ssl machinery that we are catching and ignoring, falling back to python's built-in ssl module that does not support OCSP.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: