Module TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Import alias Import alias alias alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam defaults NameLoad body Expr Str Expr Call NameLoad keyword NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Dict Str Dict Str Str Str NameLoad NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Expr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Num While NameLoad body If CompareGt NameLoad Num body Raise Call NameLoad Str TryExcept body Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Break handlers ExceptHandler type NameLoad body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Delete NameDel AugAssignAdd NameStore Num Assign NameStore Str Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Dict Str Str NameLoad AttributeLoad NameLoad attr Expr Call NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Dict Str Str Str Str NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Dict Str Str Str Str NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Dict Str Str Str Str Str Str NameLoad AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword Dict Str Str NameLoad AttributeLoad NameLoad attr With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword Dict Str Str Str Str NameLoad AttributeLoad NameLoad attr NameLoad NameLoad With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A N/A N/A unittest2 unittest N/A N/A N/A ImportError N/A N/A unittest N/A os sys traceback logging ssl cassandra.cluster Cluster NoHostAvailable cassandra ConsistencyLevel cassandra.query SimpleStatement tests.integration use_singledc PROTOCOL_VERSION get_cluster remove_cluster N/A log N/A N/A logging getLogger __name__ N/A DEFAULT_PASSWORD pythondriver N/A SERVER_KEYSTORE_PATH tests/integration/long/ssl/.keystore N/A SERVER_TRUSTSTORE_PATH tests/integration/long/ssl/.truststore N/A CLIENT_CA_CERTS tests/integration/long/ssl/cassandra.pem N/A DRIVER_KEYFILE tests/integration/long/ssl/driver.key N/A DRIVER_CERTFILE tests/integration/long/ssl/driver.pem N/A DRIVER_CERTFILE_BAD tests/integration/long/ssl/python_driver_bad.pem setup_cluster_ssl N/A N/A client_auth N/A False N/A N/A 
    We need some custom setup for this module. This will start the ccm cluster with basic
    ssl connectivity, and client authenticiation if needed.
     N/A N/A use_singledc start False N/A ccm_cluster N/A get_cluster N/A N/A N/A ccm_cluster stop N/A abs_path_server_keystore_path N/A N/A N/A os path abspath SERVER_KEYSTORE_PATH N/A config_options N/A client_encryption_options N/A enabled keystore keystore_password True abs_path_server_keystore_path DEFAULT_PASSWORD N/A client_auth N/A N/A abs_path_server_truststore_path N/A N/A N/A os path abspath SERVER_TRUSTSTORE_PATH N/A client_encyrption_options N/A config_options N/A client_encryption_options N/A N/A client_encyrption_options N/A require_client_auth True N/A N/A client_encyrption_options N/A truststore abs_path_server_truststore_path N/A N/A client_encyrption_options N/A truststore_password DEFAULT_PASSWORD N/A N/A N/A ccm_cluster set_configuration_options config_options N/A N/A N/A ccm_cluster start wait_for_binary_proto True wait_other_notice True N/A teardown_module N/A N/A N/A N/A N/A 
    The rest of the tests don't need ssl enabled, remove the cluster so as to not interfere with other tests.
     N/A ccm_cluster N/A get_cluster N/A N/A N/A ccm_cluster stop N/A N/A remove_cluster N/A validate_ssl_options N/A N/A ssl_options N/A N/A N/A tries 0 N/A True N/A N/A N/A tries 5 N/A N/A N/A RuntimeError Failed to connect to SSL cluster after 5 attempts N/A N/A N/A cluster N/A Cluster protocol_version PROTOCOL_VERSION ssl_options ssl_options N/A session N/A N/A cluster connect N/A N/A N/A N/A Exception N/A N/A N/A ex_type ex tb N/A N/A sys exc_info N/A N/A N/A log warn N/A N/A {0}: {1} Backtrace: {2} format N/A ex_type __name__ ex N/A N/A traceback extract_tb tb N/A tb N/A tries 1 N/A insert_keyspace CREATE KEYSPACE ssltest
            WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'}
             N/A statement N/A SimpleStatement insert_keyspace N/A N/A statement consistency_level 3 N/A N/A N/A session execute statement N/A drop_keyspace DROP KEYSPACE ssltest N/A statement N/A SimpleStatement drop_keyspace N/A N/A statement consistency_level N/A ConsistencyLevel ANY N/A N/A N/A session execute statement N/A N/A N/A cluster shutdown N/A SSLConnectionTests N/A N/A unittest TestCase N/A setUpClass N/A N/A cls N/A N/A N/A N/A setup_cluster_ssl N/A classmethod test_can_connect_with_ssl_ca N/A N/A self N/A N/A N/A 
        Test to validate that we are able to connect to a cluster using ssl.

        test_can_connect_with_ssl_ca performs a simple sanity check to ensure that we can connect to a cluster with ssl
        authentication via simple server-side shared certificate authority. The client is able to validate the identity
        of the server, however by using this method the server can't trust the client unless additional authentication
        has been provided.

        @since 2.6.0
        @jira_ticket PYTHON-332
        @expected_result The client can connect via SSL and preform some basic operations

        @test_category connection:ssl
         N/A abs_path_ca_cert_path N/A N/A N/A os path abspath CLIENT_CA_CERTS N/A ssl_options N/A ca_certs ssl_version abs_path_ca_cert_path N/A ssl PROTOCOL_TLSv1 N/A N/A validate_ssl_options ssl_options ssl_options N/A test_can_connect_with_ssl_ca_host_match N/A N/A self N/A N/A N/A 
        Test to validate that we are able to connect to a cluster using ssl, and host matching

        test_can_connect_with_ssl_ca_host_match performs a simple sanity check to ensure that we can connect to a cluster with ssl
        authentication via simple server-side shared certificate authority. It also validates that the host ip matches what is expected

        @since 3.3
        @jira_ticket PYTHON-296
        @expected_result The client can connect via SSL and preform some basic operations, with check_hostname specified

        @test_category connection:ssl
         N/A abs_path_ca_cert_path N/A N/A N/A os path abspath CLIENT_CA_CERTS N/A ssl_options N/A ca_certs ssl_version cert_reqs check_hostname abs_path_ca_cert_path N/A ssl PROTOCOL_TLSv1 N/A ssl CERT_REQUIRED True N/A N/A validate_ssl_options ssl_options ssl_options N/A N/A SSLConnectionAuthTests N/A N/A unittest TestCase N/A setUpClass N/A N/A cls N/A N/A N/A N/A setup_cluster_ssl client_auth True N/A classmethod test_can_connect_with_ssl_client_auth N/A N/A self N/A N/A N/A 
        Test to validate that we can connect to a C* cluster that has client_auth enabled.

        This test will setup and use a c* cluster that has client authentication enabled. It will then attempt
        to connect using valid client keys, and certs (that are in the server's truststore), and attempt to preform some
        basic operations
        @since 2.7.0

        @expected_result The client can connect via SSL and preform some basic operations

        @test_category connection:ssl
         N/A abs_path_ca_cert_path N/A N/A N/A os path abspath CLIENT_CA_CERTS N/A abs_driver_keyfile N/A N/A N/A os path abspath DRIVER_KEYFILE N/A abs_driver_certfile N/A N/A N/A os path abspath DRIVER_CERTFILE N/A ssl_options N/A ca_certs ssl_version keyfile certfile abs_path_ca_cert_path N/A ssl PROTOCOL_TLSv1 abs_driver_keyfile abs_driver_certfile N/A N/A validate_ssl_options ssl_options N/A test_can_connect_with_ssl_client_auth_host_name N/A N/A self N/A N/A N/A 
        Test to validate that we can connect to a C* cluster that has client_auth enabled, and hostmatching

        This test will setup and use a c* cluster that has client authentication enabled. It will then attempt
        to connect using valid client keys, and certs (that are in the server's truststore), and attempt to preform some
        basic operations, with check_hostname specified
        @jira_ticket PYTHON-296
        @since 3.3

        @expected_result The client can connect via SSL and preform some basic operations

        @test_category connection:ssl
         N/A abs_path_ca_cert_path N/A N/A N/A os path abspath CLIENT_CA_CERTS N/A abs_driver_keyfile N/A N/A N/A os path abspath DRIVER_KEYFILE N/A abs_driver_certfile N/A N/A N/A os path abspath DRIVER_CERTFILE N/A ssl_options N/A ca_certs ssl_version keyfile certfile cert_reqs check_hostname abs_path_ca_cert_path N/A ssl PROTOCOL_TLSv1 abs_driver_keyfile abs_driver_certfile N/A ssl CERT_REQUIRED True N/A N/A validate_ssl_options ssl_options N/A test_cannot_connect_without_client_auth N/A N/A self N/A N/A N/A 
        Test to validate that we cannot connect without client auth.

        This test will omit the keys/certs needed to preform client authentication. It will then attempt to connect
        to a server that has client authentication enabled.

        @since 2.7.0
        @expected_result The client will throw an exception on connect

        @test_category connection:ssl
         N/A abs_path_ca_cert_path N/A N/A N/A os path abspath CLIENT_CA_CERTS N/A cluster N/A Cluster protocol_version PROTOCOL_VERSION ssl_options N/A ca_certs ssl_version abs_path_ca_cert_path N/A ssl PROTOCOL_TLSv1 N/A N/A N/A self assertRaises NoHostAvailable context N/A N/A N/A N/A cluster connect N/A N/A N/A cluster shutdown N/A test_cannot_connect_with_bad_client_auth N/A N/A self N/A N/A N/A 
         Test to validate that we cannot connect with invalid client auth.

        This test will use bad keys/certs to preform client authentication. It will then attempt to connect
        to a server that has client authentication enabled.


        @since 2.7.0
        @expected_result The client will throw an exception on connect

        @test_category connection:ssl
         N/A abs_path_ca_cert_path N/A N/A N/A os path abspath CLIENT_CA_CERTS N/A abs_driver_keyfile N/A N/A N/A os path abspath DRIVER_KEYFILE N/A abs_driver_certfile N/A N/A N/A os path abspath DRIVER_CERTFILE_BAD N/A cluster N/A Cluster protocol_version PROTOCOL_VERSION ssl_options N/A ca_certs ssl_version keyfile certfile abs_path_ca_cert_path N/A ssl PROTOCOL_TLSv1 abs_driver_keyfile abs_driver_certfile N/A N/A N/A self assertRaises NoHostAvailable context N/A N/A N/A N/A cluster connect N/A N/A N/A cluster shutdown N/A N/A