安装pyOpenSSL报错
安装pyOpenSSL-0.13.tar.gz,报错。
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_context’:
OpenSSL/ssl/connection.c:289: 警告:隐式声明函数 ‘SSL_set_SSL_CTX’
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_get_servername’:
OpenSSL/ssl/connection.c:313: 错误:‘TLSEXT_NAMETYPE_host_name’ 未声明 (在此函数内第一次使用)
OpenSSL/ssl/connection.c:313: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
OpenSSL/ssl/connection.c:313: 错误:所在的函数内只报告一次。)
OpenSSL/ssl/connection.c:320: 警告:隐式声明函数 ‘SSL_get_servername’
OpenSSL/ssl/connection.c:320: 警告:赋值时将整数赋给指针,未作类型转换
OpenSSL/ssl/connection.c: In function ‘ssl_Connection_set_tlsext_host_name’:
OpenSSL/ssl/connection.c:346: 警告:隐式声明函数 ‘SSL_set_tlsext_host_name’
安装的命令如下:
curl -L -O http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz && tar zxvf pyOpenSSL-0.13.tar.gz && cd pyOpenSSL-0.13 && sudo python2.7 setup.py install
问题总是很多,并且莫名其妙。
stackoverflow的大拿比较多,告诉说。 只要安装低版本的pyOpenssl ,例如0.12版本的就行了。
curl -L -O http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.12.tar.gz && tar zxvf pyOpenSSL-0.12.tar.gz && cd pyOpenSSL-0.12 && sudo python2.7 setup.py install (这样就ok了)
具体的原因如下:
upport 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.
此篇文章已被阅读2605 次