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

librarian python error: name 'PROTOCOL_SSLv3' is not defined #3

Open
pdp7 opened this issue Dec 15, 2015 · 3 comments
Open

librarian python error: name 'PROTOCOL_SSLv3' is not defined #3

pdp7 opened this issue Dec 15, 2015 · 3 comments

Comments

@pdp7
Copy link

pdp7 commented Dec 15, 2015

I encountered this Python error for librarian.app on Debian 8.2 x86_64:

_name 'PROTOCOL_SSLv3' is not defined_

It seems related to:
gevent/gevent#513

I will try orx86 on other x86_64 systems I have too.

The full error:

afustini@lappy486 ~/dev/outernet/orx86 (master)*$ sudo python -m librarian.app --conf /etc/outernet/librarian.ini
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/librarian/app.py", line 16, in <module>
    gevent.monkey.patch_all(aggressive=True)
  File "/usr/local/lib/python2.7/dist-packages/gevent/monkey.py", line 185, in patch_all
    patch_socket(dns=dns, aggressive=aggressive)
  File "/usr/local/lib/python2.7/dist-packages/gevent/monkey.py", line 124, in patch_socket
    from gevent import socket
  File "/usr/local/lib/python2.7/dist-packages/gevent/socket.py", line 659, in <module>
    from gevent.ssl import sslwrap_simple as ssl, SSLError as sslerror, SSLSocket as SSLType
  File "/usr/local/lib/python2.7/dist-packages/gevent/ssl.py", line 386, in <module>
    def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
NameError: name 'PROTOCOL_SSLv3' is not defined

afustini@lappy486 ~/dev/outernet/orx86 (master)*$ pip2 list|grep librarian
librarian (0.4.post5)
afustini@lappy486 ~/dev/outernet/orx86 (master)*$ python --version
Python 2.7.9
@pdp7
Copy link
Author

pdp7 commented Dec 15, 2015

I used the trivial patch from this Debian bug report:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770276

afustini@lappy486 ~/dev/outernet/orx86 (master)*$ git diff /usr/local/lib/python2.7/dist-packages/gevent/ssl.py_20151214 /usr/local/lib/python2.7/dist-packages/gevent/ssl.py 
diff --git a/usr/local/lib/python2.7/dist-packages/gevent/ssl.py_20151214 b/usr/local/lib/python2.7/dist-packages/gevent/ssl.py
index ce64347..93c0d64 100644
--- a/usr/local/lib/python2.7/dist-packages/gevent/ssl.py_20151214
+++ b/usr/local/lib/python2.7/dist-packages/gevent/ssl.py
@@ -383,7 +383,7 @@ def wrap_socket(sock, keyfile=None, certfile=None,
                      ciphers=ciphers)


-def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
     """Retrieve the certificate from the server at the specified address,
     and return it as a PEM-encoded string.
     If 'ca_certs' is specified, validate the server cert against it.
afustini@lappy486 ~/dev/outernet/orx86 (master)*$ 

librarian was then able to start:

afustini@lappy486 ~/dev/outernet/orx86 (master)*$ sudo python -m librarian.app --conf /etc/outernet/librarian.ini
Press Ctrl-C to shut down Librarian.

@pdp7
Copy link
Author

pdp7 commented Dec 15, 2015

fyi - my installed is gevent is v1.0.1

@pdp7 pdp7 closed this as completed Dec 15, 2015
@ben-en
Copy link

ben-en commented Dec 15, 2015

Gevent v1.0.1 is a security hazard, due to the use of SSL3 and the POODLE vulnerability: https://access.redhat.com/articles/1232123

Projects that use gevent and use the 'gevent>=1.0.1' selector should be updated to 1.0.2.

@ben-en ben-en reopened this Dec 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants