This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SSL connect() raises SSLError "[SSL] EC lib (_ssl.c:728)"
Type: Stage: resolved
Components: SSL Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: andymaier, christian.heimes
Priority: normal Keywords:

Created on 2019-11-15 08:33 by andymaier, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (7)
msg356654 - (view) Author: Andy Maier (andymaier) * Date: 2019-11-15 08:33
A user of our pywbem package gets an SSLError with message "[SSL] EC lib (_ssl.c:728)" when invoking the connect() method on an SSL wrapped socket. See https://github.com/pywbem/pywbem/issues/1950.

The issue is that with this error message, it is not possible for us to figure out what the problem is and how to correct it.

This happens with CPython 3.5.

I have tried to find the place in _ssl.c (https://github.com/python/cpython/blob/3.5/Modules/_ssl.c) where a string "EC lib" or " lib" is created but did not find it there.

I have two requests:

1. Please explain what the reason is for this exception and what to change in the environment to make it work.

2. Please improve the message in this exception so that it is self-explanatory.
msg356657 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-11-15 08:52
The error message is coming from OpenSSL, not from Python. It looks like the handshake is failing with a problem in OpenSSL's internal elliptic curve crypto. It usually means that the server is sending handshake parameters or certs that the client cannot process. It could be a problem with key agreement with ECDHE or cert validation with an EC cert.

It's impossible to say what exactly is going wrong. I suggest that you start by debugging the issue with openssl s_client, Wireshark and gdb on the system.
msg356659 - (view) Author: Andy Maier (andymaier) * Date: 2019-11-15 09:02
More details about the environment this happens on:

Python 3.5.7 (default, Aug 16 2019, 10:17:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
msg356662 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-11-15 09:13
This looks like a self-compiled Python 3.5 on an ancient, unsupported RHEL 4 box. What's the OpenSSL version of the machine and the server?
msg356665 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-11-15 09:26
Sorry, Kernel version 4.4.7 is RHEL 6.
msg357547 - (view) Author: Andy Maier (andymaier) * Date: 2019-11-27 01:31
Our user was able to fix this issue by upgrading the OpenSSL version used on the client side from 1.0.1e-fips to 1.1.1.

It seems to me that Python's SSL support cannot do anything about this issue. As far as I'm concerned ths issue can be closed.
msg357548 - (view) Author: Andy Maier (andymaier) * Date: 2019-11-27 01:32
Thanks for the help, Christian!
History
Date User Action Args
2022-04-11 14:59:23adminsetgithub: 82991
2019-11-27 04:12:56benjamin.petersonsetstatus: open -> closed
resolution: not a bug
stage: resolved
2019-11-27 01:32:14andymaiersetmessages: + msg357548
2019-11-27 01:31:25andymaiersetmessages: + msg357547
2019-11-15 09:26:27christian.heimessetmessages: + msg356665
2019-11-15 09:13:21christian.heimessetmessages: + msg356662
2019-11-15 09:02:34andymaiersetmessages: + msg356659
2019-11-15 08:52:55christian.heimessetmessages: + msg356657
2019-11-15 08:33:40andymaiercreate