Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to etcd failed due to SSLError #236

Open
halcyonone opened this issue Mar 20, 2017 · 7 comments
Open

Connection to etcd failed due to SSLError #236

halcyonone opened this issue Mar 20, 2017 · 7 comments

Comments

@halcyonone
Copy link

I use ssl connect to etcd server, the error is etcd.EtcdConnectionFailed: Connection to etcd failed due to SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),)

my etcd server version is 3.1.3, python-etcd version is 0.4.5, please help me, thx.

@cizixs
Copy link

cizixs commented Apr 25, 2017

Had the same issue here, Is there a way to skip SSL verification?

@yejw5
Copy link

yejw5 commented May 18, 2017

I'm using etcd ssl connect too. Can you show your code in connect to etcd with etcd.Client()? Thank you very much!

@ColinChartier
Copy link

ColinChartier commented Jun 15, 2017

Fix -- force TLS1.2 (this will error if your python doesn't support it)

import etcd
import ssl
c = etcd.Client(host='localhost', port=2379, cert=('/certs/cert', '/certs/key'), ca_cert='/certs/ca_cert', protocol='https')
c.http.connection_pool_kw['ssl_version'] = ssl.PROTOCOL_TLSv1_2  

@lavagetto
Copy link
Collaborator

@ColinChartier I like your patch, although I'm thinking we should just go with TLS 1.2 by default on any python version that supports it. Maybe drop support for any pyopenssl version that doesn't?

@ColinChartier
Copy link

@lavagetto I'm not actually sure which ETCD versions support which encryption versions -- I know for sure that you will alienate a lot of python 2 folks on Mac at least if you do that.

The problem is that python itself needs to be recompiled with the specific openssl version, unless you use PyOpenSSL or whatever, and that is a huge hassle in general.

@ColinChartier
Copy link

Also-- I upgraded python-etcd after the patch that removed forced TLS1.1 in the constructor and everything is working for me (this issue no longer presents), so I suppose that newer ETCD servers only accept TLS1.2. You could give a more descriptive error message if negotiation fails and the TLSv1_2 constant is unset in ssl.py

@hanhailin
Copy link

I have the same problem , who can help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants