简体   繁体   English

Python cassandra驱动程序-SSL:WRONG_VERSION_NUMBER

[英]Python cassandra driver - SSL: WRONG_VERSION_NUMBER

I'm trying to connect to a cassandra node that has SSL enabled, using the datastax cassandra driver, like this: 我正在尝试使用datastax cassandra驱动程序连接到已启用SSL的cassandra节点,如下所示:

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() 

I can successfully connect to the node using pycassa , but I was trying to switch to using datastax driver for this. 我可以使用pycassa成功连接到该节点,但是pycassa我试图切换为使用datastax driver

The above code throws the following exception: 上面的代码引发以下异常:

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)")})

I know the server accepts PROTOCOL_TLSv1, since it's the default protocol in pycassa. 我知道服务器接受PROTOCOL_TLSv1,因为它是pycassa中的默认协议。 I don't understand what I'm doing wrong here ... 我不明白我在做什么错...

This error commonly occurs when trying to connect with SSL on a socket that is not negotiating SSL. 尝试在未协商SSL的套接字上与SSL连接时,通常会发生此错误。

Confirm that SSL is enabled in the server, and for the port to which you are connecting. 确认已在服务器中以及要连接的端口上启用SSL。 I think this should be evident in the server system log. 我认为这在服务器系统日志中应该很明显。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SSL:PYTHON 请求上的 WRONG_VERSION_NUMBER - SSL: WRONG_VERSION_NUMBER ON PYTHON REQUEST Python-Django [SSL:WRONG_VERSION_NUMBER]错误 - Python-Django [SSL: WRONG_VERSION_NUMBER] Error python 3 smtplib 异常:“SSL:WRONG_VERSION_NUMBER”登录到 Outlook - python 3 smtplib exception: 'SSL: WRONG_VERSION_NUMBER' logging in to outlook jupyter SSL:WRONG_VERSION_NUMBER - jupyter SSL: WRONG_VERSION_NUMBER python 请求:(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] 错误的版本号 (_ssl.c:1123)')) - python requests: (SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')) python elasticsearch elasticsearch.exceptions.SSLError: ConnectionError([SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)) - python elasticsearch elasticsearch.exceptions.SSLError: ConnectionError([SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)) Azure 函数 (Python) 无法使用 [SSL: WRONG_VERSION_NUMBER] 连接到 Azure MySQL 实例 - Azure Functions (Python) cannot connect to Azure MySQL instance with [SSL: WRONG_VERSION_NUMBER] Python 错误 SSL: WRONG_VERSION_NUMBER 在几天前工作的代码上 - Python ERROR SSL: WRONG_VERSION_NUMBER on code that worked few days earlier Flask-Mail [SSL: WRONG_VERSION_NUMBER] 错误的版本号 (_ssl.c:1123) - Flask-Mail [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123) 如何修复错误 ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] 版本号错误? - How to fix the error ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM