已解决哇,这些家伙真快...基本上就是这个https://github.com/pyca/cryptography/issues/2750。结果openssl的一个安全更新(DROWN攻击)发布了,而该更新包含了一个意外的函数签名更改,导致了不兼容性,所以这对我来说只是倒霉。
我需要在运行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年3月1日发布(昨天),而alpine软件包已经升级到该版本。这可能与此有关吗?
我该如何解决这个问题?也许可以设置一些环境变量?
更新:我一直在检查openssl的GitHub Repo,实际上在1.0.2f到1.0.2g的过渡期间,openssl/bio.h
的BIO *BIO_new_mem_buf(void *buf, int len)
已更改为BIO *BIO_new_mem_buf(const void *buf, int len)
(在https://github.com/openssl/openssl/compare/OpenSSL_1_0_2f...OpenSSL_1_0_2g中搜索“BIO_new_mem_buf”)。我不知道这个导入过时版本openssl/bio.h
的openssl/asn1.h
是从哪里来的,因为它看起来不像openssl repo中的那个。有什么建议吗?
好的,我看到有些人已经在解决这个问题了:https://github.com/pyca/cryptography/issues/2750