@@ -3045,12 +3045,16 @@ async def asyncSetUp(self):
30453045 async def http_post (self , path , data = None ):
30463046 # Note, the connection to the mock server needs to be closed after
30473047 # each request because the server is single threaded.
3048- # Use PROTOCOL_TLS_CLIENT instead of create_default_context so that
3049- # X509_V_FLAG_X509_STRICT is not set. Python 3.14 enables strict mode
3050- # in create_default_context, which requires SKI on the root CA cert.
3051- # We intentionally omit SKI from the CA cert to prevent macOS SecTrust
3052- # from triggering OCSP revocation checks during MongoDB server startup.
3053- ctx = ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
3048+ if sys .platform == "darwin" :
3049+ # macOS: use PROTOCOL_TLS_CLIENT instead of create_default_context
3050+ # so that X509_V_FLAG_X509_STRICT is not set. Python 3.14 enables
3051+ # strict mode in create_default_context, which requires SKI on the
3052+ # root CA cert. We intentionally omit SKI from the CA cert to
3053+ # prevent macOS SecTrust from triggering OCSP revocation checks
3054+ # during MongoDB server startup.
3055+ ctx = ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
3056+ else :
3057+ ctx = ssl .create_default_context ()
30543058 ctx .load_verify_locations (cafile = CA_PEM )
30553059 ctx .load_cert_chain (CLIENT_PEM )
30563060 conn = http .client .HTTPSConnection ("127.0.0.1:9003" , context = ctx )
0 commit comments