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

Python ssl module import is broken due to undefined EC_GROUP_new_curve_GF2m symbols in openssl #2550

Open
ruslanloman opened this Issue Feb 14, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@ruslanloman
Copy link

ruslanloman commented Feb 14, 2019

Bug

# ./python
Python 3.5.3 (fdd60ed87e94, Apr 24 2018, 06:10:04)
[PyPy 6.0.0 with GCC 6.2.0 20160901] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/core/pypy3/lib-python/3/ssl.py", line 99, in <module>
    import _ssl             # if we can't import it, let the error propagate
  File "/home/core/pypy3/lib_pypy/_ssl/__init__.py", line 1, in <module>
    from _cffi_ssl._stdssl import (_PROTOCOL_NAMES, _OPENSSL_API_VERSION,
  File "/home/core/pypy3/lib_pypy/_cffi_ssl/_stdssl/__init__.py", line 6, in <module>
    from _pypy_openssl import ffi
ImportError: /home/core/pypy3/lib_pypy/_pypy_openssl.pypy3-60-x86_64-linux-gnu.so: symbol EC_GROUP_new_curve_GF2m, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference

Container Linux Version

NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1967.3.0
VERSION_ID=1967.3.0
BUILD_ID=2019-01-08-0044
PRETTY_NAME="Container Linux by CoreOS 1967.3.0 (Rhyolite)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"

OpenSSL version: OpenSSL 1.0.2p  14 Aug 2018

Expected Behavior

Python ssl module is imported successfully

Actual Behavior

Python ssl module import is failed with Import Error exception

Reproduction Steps

  1. Install python3.5/3.6 version from official documentation
  2. Try to import ssl module

Other Information

CoreOS 1911.3.0 is not affected, I think because it uses different openssl version: OpenSSL 1.0.2o 27 Mar 2018

@ruslanloman

This comment has been minimized.

Copy link
Author

ruslanloman commented Feb 14, 2019

jfyi as w/a python portable could be used that includes all needed libs, as example see this ansible role [1]

[1] https://github.com/instrumentisto/ansible-coreos-bootstrap/blob/master/files/install_python.sh#L20

@dm0-

This comment has been minimized.

Copy link
Member

dm0- commented Feb 14, 2019

Your services should be run in a container. See the toolbox command for one-off scripts that need to use the host file system. Executing binaries compiled for different systems on the host should not be expected to work.

For clarity, this is unrelated to the Container Linux 1967.3.0 Python, which works fine:

dev ~ # python3
Python 3.6.5 (default, Jan  7 2019, 22:46:53) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2p  14 Aug 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.