不能在Docker Alpine Linux 3.3中使用OpenSSL 1.0.2g和Python 2.7“安装encryption”

解决哇,这些家伙很快…基本上这是https://github.com/pyca/cryptography/issues/2750事实certificate,openssl的安全更新被释放(DROWN攻击),该更新包含一个意想不到的function签名的变化造成了不兼容,所以这对我来说只是运气不好。


我需要在运行Alpine Linux的Docker容器中使用pip install cryptography 。 实际上,它是另一个模块, service_identity ,但问题在于cryptography模块,这是一个依赖项。

我有以下的Dockerfile

 FROM alpine:3.3 RUN apk --update add build-base libffi-dev openssl-dev python-dev py-pip RUN pip install cryptography 

失败,出现以下错误

 generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c' building '_openssl' extension creating build/temp.linux-x86_64-2.7/build creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7 gcc -fno-strict-aliasing -Os -fomit-frame-pointer -DNDEBUG -Os -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o build/temp.linux-x86_64-2.7/_openssl.c:726:6: error: conflicting types for 'BIO_new_mem_buf' BIO *BIO_new_mem_buf(void *, int); ^ In file included from /usr/include/openssl/asn1.h:65:0, from build/temp.linux-x86_64-2.7/_openssl.c:434: /usr/include/openssl/bio.h:692:6: note: previous declaration of 'BIO_new_mem_buf' was here BIO *BIO_new_mem_buf(const void *buf, int len); ^ error: command 'gcc' failed with exit status 1 

openssl 1.0.2g于2016-03-01(昨天)发布,高山包已经更新到该版本。 它可以与此有关吗?

我该如何解决这个问题? 也许我可以设置一些环境variables?

更新我一直在检查GitHub Repo for openssl,事实上,在BIO *BIO_new_mem_buf(void *buf, int len)openssl/bio.h BIO *BIO_new_mem_buf(void *buf, int len)变成了BIO *BIO_new_mem_buf(const void *buf, int len) .2f到1.0.2g转换(在https://github.com/openssl/openssl/compare/OpenSSL_1_0_2f…OpenSSL_1_0_2g中search“BIO_new_mem_buf”)。 我不知道这个openssl/asn1.h来自哪里,这是导入过时的版本的openssl/bio.h ,因为它看起来不像openssl repo中的那个。 有任何想法吗?

好吧,我看到一些已经在这个工作: https : //github.com/pyca/cryptography/issues/2750