Python cassandra驱动程序-SSL:错误的版本号
我正在尝试使用datastax cassandra驱动程序连接到启用SSL的cassandra节点,如下所示:Python cassandra驱动程序-SSL:错误的版本号,python,ssl,cassandra,datastax,Python,Ssl,Cassandra,Datastax,我正在尝试使用datastax cassandra驱动程序连接到启用SSL的cassandra节点,如下所示: from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider import ssl ip = <ip> ap = PlainTextAuthProvider(username=<username>, password=<password>
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
import ssl
ip = <ip>
ap = PlainTextAuthProvider(username=<username>, password=<password>)
ssl_options = {
'ca_certs': <path to PEM file>,
'ssl_version': ssl.PROTOCOL_TLSv1
}
cluster = Cluster([ip], auth_provider=ap, ssl_options=ssl_options)
session = cluster.connect()
我知道服务器接受协议_TLSv1,因为它是pycassa中的默认协议。我不明白我在这里做错了什么…当尝试在不协商SSL的套接字上连接SSL时,通常会发生此错误
确认服务器中以及您要连接的端口已启用SSL。我认为这在服务器系统日志中应该很明显。我现在觉得自己很愚蠢。。。服务器上已禁用SSL。谢谢你的回复!
NoHostAvailable: ('Unable to connect to any servers', {<ip>: error(1, u"Tried connecting to [(<ip>, <port>)]. Last error: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:590)")})