Copilot commented on code in PR #1293:
URL: 
https://github.com/apache/cassandra-python-driver/pull/1293#discussion_r3561453717


##########
tests/integration/long/test_ssl.py:
##########
@@ -314,10 +305,6 @@ def test_cannot_connect_with_bad_client_auth(self):
                        'ssl_version': ssl_version,
                        'keyfile': DRIVER_KEYFILE}
 
-        if not USES_PYOPENSSL:
-            # I don't set the bad certfile for pyopenssl because it hangs
-            ssl_options['certfile'] = DRIVER_CERTFILE_BAD
-
         cluster = TestCluster(

Review Comment:
   `test_cannot_connect_with_bad_client_auth` no longer uses 
`DRIVER_CERTFILE_BAD`, so it no longer exercises the intended "bad client auth" 
scenario and leaves `ssl_options` unused. Restoring the bad certfile (and 
reusing the `ssl_options` dict) makes the test meaningful again.



##########
tests/integration/long/test_ssl.py:
##########
@@ -22,8 +22,6 @@
 from cassandra import ConsistencyLevel
 from cassandra.query import SimpleStatement
 
-from OpenSSL import SSL, crypto
-
 from tests.integration import (
     get_cluster, remove_cluster, use_single_node, start_cluster_wait_for_up, 
EVENT_LOOP_MANAGER, TestCluster
 )

Review Comment:
   `EVENT_LOOP_MANAGER` is imported but no longer used in this module after 
removing the pyOpenSSL/twisted/eventlet branches. Dropping it avoids dead 
imports.



##########
tests/integration/long/test_ssl.py:
##########
@@ -50,16 +48,9 @@
 DRIVER_CERTFILE = 
os.path.abspath("tests/integration/long/ssl/client.crt_signed")
 DRIVER_CERTFILE_BAD = 
os.path.abspath("tests/integration/long/ssl/client_bad.key")
 
-USES_PYOPENSSL = "twisted" in EVENT_LOOP_MANAGER or "eventlet" in 
EVENT_LOOP_MANAGER
-if "twisted" in EVENT_LOOP_MANAGER:
-    import OpenSSL
-    ssl_version = OpenSSL.SSL.TLSv1_2_METHOD
-    verify_certs = {'cert_reqs': SSL.VERIFY_PEER,
-                    'check_hostname': True}
-else:
-    ssl_version = ssl.PROTOCOL_TLS
-    verify_certs = {'cert_reqs': ssl.CERT_REQUIRED,
-                    'check_hostname': True}
+ssl_version = ssl.PROTOCOL_TLS
+verify_certs = {'cert_reqs': ssl.CERT_REQUIRED,
+                'check_hostname': True}

Review Comment:
   `verify_callback` is now unused after removing the pyOpenSSL-specific 
`set_verify(..., callback=...)` paths. Consider removing it to avoid dead code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to