easy_install PyOpenSSL 错误
知道导致以下错误的原因吗?
我使用 Linux centos 和 openssl-devel.i386 0.9.8e-12.el5_5.7
$ easy_install PyOpenSSL
Searching for PyOpenSSL
Reading http://pypi.python.org/simple/PyOpenSSL/
Reading http://launchpad.net/pyopenssl
Reading http://pyopenssl.sourceforge.net/
Best match: pyOpenSSL 0.13
Downloading http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz#md5=767bca18a71178ca353dff9e10941929
Processing pyOpenSSL-0.13.tar.gz
Running pyOpenSSL-0.13/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Dunib/pyOpenSSL-0.13/egg-dist-tmp-aV6OCC
warning: no previously-included files matching '*.pyc' found anywhere in distribution
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_context’:
OpenSSL/ssl/connection.c:289: warning: implicit declaration of function ‘SSL_set_SSL_CTX’
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_get_servername’:
OpenSSL/ssl/connection.c:313: error: ‘TLSEXT_NAMETYPE_host_name’ undeclared (first use in this function)
OpenSSL/ssl/connection.c:313: error: (Each undeclared identifier is reported only once
OpenSSL/ssl/connection.c:313: error: for each function it appears in.)
OpenSSL/ssl/connection.c:320: warning: implicit declaration of function ‘SSL_get_servername’
OpenSSL/ssl/connection.c:320: warning: assignment makes pointer from integer without a cast
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_tlsext_host_name’:
OpenSSL/ssl/connection.c:346: warning: implicit declaration of function ‘SSL_set_tlsext_host_name’
error: Setup script exited with error: command 'gcc' failed with exit status 1
Any idea about what cause the error below ?
I use Linux centos with openssl-devel.i386 0.9.8e-12.el5_5.7
$ easy_install PyOpenSSL
Searching for PyOpenSSL
Reading http://pypi.python.org/simple/PyOpenSSL/
Reading http://launchpad.net/pyopenssl
Reading http://pyopenssl.sourceforge.net/
Best match: pyOpenSSL 0.13
Downloading http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz#md5=767bca18a71178ca353dff9e10941929
Processing pyOpenSSL-0.13.tar.gz
Running pyOpenSSL-0.13/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Dunib/pyOpenSSL-0.13/egg-dist-tmp-aV6OCC
warning: no previously-included files matching '*.pyc' found anywhere in distribution
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_context’:
OpenSSL/ssl/connection.c:289: warning: implicit declaration of function ‘SSL_set_SSL_CTX’
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_get_servername’:
OpenSSL/ssl/connection.c:313: error: ‘TLSEXT_NAMETYPE_host_name’ undeclared (first use in this function)
OpenSSL/ssl/connection.c:313: error: (Each undeclared identifier is reported only once
OpenSSL/ssl/connection.c:313: error: for each function it appears in.)
OpenSSL/ssl/connection.c:320: warning: implicit declaration of function ‘SSL_get_servername’
OpenSSL/ssl/connection.c:320: warning: assignment makes pointer from integer without a cast
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_tlsext_host_name’:
OpenSSL/ssl/connection.c:346: warning: implicit declaration of function ‘SSL_set_tlsext_host_name’
error: Setup script exited with error: command 'gcc' failed with exit status 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
为了在 virtualenv 下安装它,您应该首先安装所需的软件包。在 ubuntu 上:
然后您只需输入:
In order to install it under virtualenv, you should first install the required packages. On ubuntu:
Then you can just type:
pyOpenSSL 0.13 引入了对(S)服务器(N)同名(I)指示 TLS 扩展的支持。此扩展允许客户端告诉服务器他们希望与之通信的主机名,从而允许服务器选择合适的证书来呈现。
OpenSSL 0.9.8f 中引入了对 SNI 的支持。因此,pyOpenSSL 0.13 将使用 OpenSSL 0.9.8f 或更高版本构建,但不会使用 OpenSSL 0.9.8e 或更早版本构建,因为它期望包装的 API 不存在。
也许较新版本的 pyOpenSSL 将使这些绑定成为可选的,恢复对 OpenSSL 0.9.8e 及更早版本的支持。然而,类似地,较新版本的 OpenSSL 也可以与 pyOpenSSL 0.13 一起使用。
pyOpenSSL 项目发布预发行版。对预发布版本进行广泛的测试有助于避免此类情况的发生。我建议任何依赖 pyOpenSSL 的人订阅(流量非常低)pyOpenSSL 用户列表(或在< a href="http://sourceforge.net/mail/?group_id=31249" rel="noreferrer">SourceForge),并在预发行版发布之前进行可以进行的测试发布已完成。
pyOpenSSL 0.13 introduced support for the (S)erver (N)ame (I)ndication TLS extension. This extension allows clients to tell the server what hostname they expect to be talking to, allowing the server to select a suitable certificate to present.
Support for SNI was introduced in OpenSSL 0.9.8f. Thus, pyOpenSSL 0.13 will build with OpenSSL 0.9.8f or later, but not OpenSSL 0.9.8e or earlier, where the APIs it expects to be wrapping do not exist.
Perhaps a newer version of pyOpenSSL will make these bindings optional, restoring support for OpenSSL 0.9.8e and earlier. However, similarly, a newer version of OpenSSL will also work with pyOpenSSL 0.13.
The pyOpenSSL project issues pre-releases. Widespread testing of pre-releases can help avoid cases like this one. I recommend that anyone relying on pyOpenSSL subscribe to the (very low traffic) pyOpenSSL user list (or on SourceForge) and do what testing you can when a pre-release comes out, before the release is finalized.
我在尝试安装 Scrapy 时遇到了这个问题。对我来说,萨纳西斯的回答不起作用。经过更多的谷歌和随机安装后,
Scrapy 安装可以为我运行(CentOS 版本 6.3(最终版))
I ran into this while trying to install Scrapy. For me, Thanasis' answer didn't work. After some more Google and randomly installing things
allowed the Scrapy install to run for me (CentOS release 6.3 (Final))
不完全是所要求的,但在 Ubuntu 12.04 中可以通过以下方式安装:
Not exactly what is asked, but in Ubuntu 12.04 it can be installed with:
对我来说,我必须安装 openssl-devel 库:
正在尝试安装 cyclone/tornado/twisted python evented lib。
For me I had to install the openssl-devel libs:
Was trying to install the cyclone/tornado/twisted python evented lib.
如果你不需要使用最新的
pyOpenSSL
,只需回滚到0.12,这是最简单的方法。有关详细信息,请查看@Jean-Paul 的答案。
If you don't need to use the lastest
pyOpenSSL
, just rolled back to 0.12, this is the simplest way.Check for @Jean-Paul's answer for detail.
尝试安装:
sudo apt-get install -y python-dev libssl-dev libffi-dev
Try to install:
sudo apt-get install -y python-dev libssl-dev libffi-dev
我无法安装 libssl-devel 或 libssl-dev,但这在 CentOS 6 上对我有用(之前安装了 pyOpenSSL 0.13.1):
I couldn't install libssl-devel or libssl-dev, but this worked for me on CentOS 6 (when pyOpenSSL 0.13.1 was previously installed):
我们有同样的问题。经过一番检查,我们找到了解决该问题的方法:
https://bugs.launchpad.net/pyopenssl/+bug/845445
你做什么正在寻找的是“Philip 的修复程序对我在 CentOS 5.6 上有效:”:
https://bugs.launchpad.net/pyopenssl/+bug/845445/comments /9
这在我们的案例中效果很好。
We had the same issue. Checking a bit we found a way to resolve it:
https://bugs.launchpad.net/pyopenssl/+bug/845445
What you're looking for is "Philip's fix works for me on CentOS 5.6:":
https://bugs.launchpad.net/pyopenssl/+bug/845445/comments/9
This worked well in our case.