Last active
March 7, 2018 04:07
-
-
Save danslimmon/6542868 to your computer and use it in GitHub Desktop.
Using Python's cql module, connect to a Cassandra server over SSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from thrift.transport import TSSLSocket | |
from thrift.transport import TTransport | |
import cql | |
sock = TSSLSocket.TSSLSocket(host='cass.example.com', port=9160, ca_certs='/path/to/ca_certs.pem') | |
trans = TTransport.TFramedTransport(sock) | |
conn = cql.connect('cass.example.com', 9160, 'keyspace', user='username', password='password', transport=trans, cql_version='3.0.0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment