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

AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1' #83

Closed
is1394 opened this Issue Feb 12, 2017 · 9 comments

Comments

Projects
None yet
6 participants
@is1394

is1394 commented Feb 12, 2017

How to resolve this error AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

@andrewgodwin

This comment has been minimized.

Show comment
Hide comment
@andrewgodwin

andrewgodwin Feb 13, 2017

Member

Can I get the full traceback please? The error itself doesn't give enough information.

Member

andrewgodwin commented Feb 13, 2017

Can I get the full traceback please? The error itself doesn't give enough information.

@Muhammad-Soban

This comment has been minimized.

Show comment
Hide comment
@Muhammad-Soban

Muhammad-Soban Mar 21, 2017

I'm also getting this error on ubuntu 14.04 LTS, Python 2.7.6, pip 1.5.4 after running the following command.

daphne -b 0.0.0.0 -p 8001 app_name.asgi:channel_layer
Traceback (most recent call last):
  File "/usr/local/bin/daphne", line 7, in <module>
    from daphne.cli import CommandLineInterface
  File "/usr/local/lib/python2.7/dist-packages/daphne/cli.py", line 5, in <module>
    from .server import Server, build_endpoint_description_strings
  File "/usr/local/lib/python2.7/dist-packages/daphne/server.py", line 4, in <module>
    from twisted.internet import reactor, defer
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py", line 44, in _getInstallFunction
    from twisted.internet.epollreactor import install
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/epollreactor.py", line 24, in <module>
    from twisted.internet import posixbase
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 18, in <module>
    from twisted.internet import error, udp, tcp
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 28, in <module>
    from twisted.internet._newtls import (
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/tls.py", line 63, in <module>
    from twisted.internet._sslverify import _setAcceptableProtocols
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_sslverify.py", line 38, in <module>
    TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

Muhammad-Soban commented Mar 21, 2017

I'm also getting this error on ubuntu 14.04 LTS, Python 2.7.6, pip 1.5.4 after running the following command.

daphne -b 0.0.0.0 -p 8001 app_name.asgi:channel_layer
Traceback (most recent call last):
  File "/usr/local/bin/daphne", line 7, in <module>
    from daphne.cli import CommandLineInterface
  File "/usr/local/lib/python2.7/dist-packages/daphne/cli.py", line 5, in <module>
    from .server import Server, build_endpoint_description_strings
  File "/usr/local/lib/python2.7/dist-packages/daphne/server.py", line 4, in <module>
    from twisted.internet import reactor, defer
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py", line 44, in _getInstallFunction
    from twisted.internet.epollreactor import install
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/epollreactor.py", line 24, in <module>
    from twisted.internet import posixbase
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 18, in <module>
    from twisted.internet import error, udp, tcp
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 28, in <module>
    from twisted.internet._newtls import (
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/tls.py", line 63, in <module>
    from twisted.internet._sslverify import _setAcceptableProtocols
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_sslverify.py", line 38, in <module>
    TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
@andrewgodwin

This comment has been minimized.

Show comment
Hide comment
@andrewgodwin

andrewgodwin Mar 21, 2017

Member

It looks like the SSL package you have installed isn't new enough for Twisted. Run pip install -U Twisted[tls] and it should bring in a new enough version.

Member

andrewgodwin commented Mar 21, 2017

It looks like the SSL package you have installed isn't new enough for Twisted. Run pip install -U Twisted[tls] and it should bring in a new enough version.

@Muhammad-Soban

This comment has been minimized.

Show comment
Hide comment
@Muhammad-Soban

Muhammad-Soban Mar 21, 2017

I have fixed the issue using the following command

pip install --upgrade pyopenssl

Thanks

Muhammad-Soban commented Mar 21, 2017

I have fixed the issue using the following command

pip install --upgrade pyopenssl

Thanks

@tivoni23

This comment has been minimized.

Show comment
Hide comment
@tivoni23

tivoni23 Jul 1, 2017

I'm getting the following error when I'm trying to runserver with channels package :
It happened inside of local server and outside.
Can someone help me ?

Unhandled exception in thread started by <function wrapper at 0x103cb7758>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(args, **kwargs)
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(
_exception)
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/init.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/Library/Python/2.7/site-packages/channels/apps.py", line 22, in ready
monkeypatch_django()
File "/Library/Python/2.7/site-packages/channels/hacks.py", line 10, in monkeypatch_django
from .management.commands.runserver import Command as RunserverCommand
File "/Library/Python/2.7/site-packages/channels/management/commands/runserver.py", line 5, in
from daphne.server import Server, build_endpoint_description_strings
File "/Library/Python/2.7/site-packages/daphne/server.py", line 4, in
from twisted.internet import reactor, defer
File "/Library/Python/2.7/site-packages/twisted/internet/reactor.py", line 38, in
from twisted.internet import default
File "/Library/Python/2.7/site-packages/twisted/internet/default.py", line 56, in
install = _getInstallFunction(platform)
File "/Library/Python/2.7/site-packages/twisted/internet/default.py", line 50, in _getInstallFunction
from twisted.internet.selectreactor import install
File "/Library/Python/2.7/site-packages/twisted/internet/selectreactor.py", line 18, in
from twisted.internet import posixbase
File "/Library/Python/2.7/site-packages/twisted/internet/posixbase.py", line 18, in
from twisted.internet import error, udp, tcp
File "/Library/Python/2.7/site-packages/twisted/internet/tcp.py", line 28, in
from twisted.internet._newtls import (
File "/Library/Python/2.7/site-packages/twisted/internet/_newtls.py", line 21, in
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/Library/Python/2.7/site-packages/twisted/protocols/tls.py", line 63, in
from twisted.internet._sslverify import _setAcceptableProtocols
File "/Library/Python/2.7/site-packages/twisted/internet/_sslverify.py", line 38, in
TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

tivoni23 commented Jul 1, 2017

I'm getting the following error when I'm trying to runserver with channels package :
It happened inside of local server and outside.
Can someone help me ?

Unhandled exception in thread started by <function wrapper at 0x103cb7758>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(args, **kwargs)
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(
_exception)
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/init.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/Library/Python/2.7/site-packages/channels/apps.py", line 22, in ready
monkeypatch_django()
File "/Library/Python/2.7/site-packages/channels/hacks.py", line 10, in monkeypatch_django
from .management.commands.runserver import Command as RunserverCommand
File "/Library/Python/2.7/site-packages/channels/management/commands/runserver.py", line 5, in
from daphne.server import Server, build_endpoint_description_strings
File "/Library/Python/2.7/site-packages/daphne/server.py", line 4, in
from twisted.internet import reactor, defer
File "/Library/Python/2.7/site-packages/twisted/internet/reactor.py", line 38, in
from twisted.internet import default
File "/Library/Python/2.7/site-packages/twisted/internet/default.py", line 56, in
install = _getInstallFunction(platform)
File "/Library/Python/2.7/site-packages/twisted/internet/default.py", line 50, in _getInstallFunction
from twisted.internet.selectreactor import install
File "/Library/Python/2.7/site-packages/twisted/internet/selectreactor.py", line 18, in
from twisted.internet import posixbase
File "/Library/Python/2.7/site-packages/twisted/internet/posixbase.py", line 18, in
from twisted.internet import error, udp, tcp
File "/Library/Python/2.7/site-packages/twisted/internet/tcp.py", line 28, in
from twisted.internet._newtls import (
File "/Library/Python/2.7/site-packages/twisted/internet/_newtls.py", line 21, in
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/Library/Python/2.7/site-packages/twisted/protocols/tls.py", line 63, in
from twisted.internet._sslverify import _setAcceptableProtocols
File "/Library/Python/2.7/site-packages/twisted/internet/_sslverify.py", line 38, in
TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

@andrewgodwin

This comment has been minimized.

Show comment
Hide comment
@andrewgodwin

andrewgodwin Jul 2, 2017

Member

It's a problem with your SSL install - I can't help you specifically. I suggest trying to upgrade it, and since it looks like you're on Mac OS, maybe try using a version from brew instead.

Member

andrewgodwin commented Jul 2, 2017

It's a problem with your SSL install - I can't help you specifically. I suggest trying to upgrade it, and since it looks like you're on Mac OS, maybe try using a version from brew instead.

@tivoni23

This comment has been minimized.

Show comment
Hide comment
@tivoni23

tivoni23 Jul 4, 2017

I ran brew upgrade and now it's working!
Thank you

tivoni23 commented Jul 4, 2017

I ran brew upgrade and now it's working!
Thank you

@ravitejar272

This comment has been minimized.

Show comment
Hide comment
@ravitejar272

ravitejar272 Sep 19, 2017

I am trying to use django channels on redhat and getting same error message. I tried to upgrade pyopenssl, twisted and yum upgrade also. I am still getting same error.

My environment:
python - 2.7.5
pip - 9.0.1
OpenSSL 17.3.0

Error:
File "/usr/lib/python2.7/site-packages/channels/management/commands/runserver.py", line 5, in
from daphne.server import Server, build_endpoint_description_strings
File "/usr/lib/python2.7/site-packages/daphne/server.py", line 8, in
from twisted.internet import reactor, defer
File "/usr/lib64/python2.7/site-packages/twisted/internet/reactor.py", line 38, in
from twisted.internet import default
File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 56, in
install = _getInstallFunction(platform)
File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 44, in _getInstallFunction
from twisted.internet.epollreactor import install
File "/usr/lib64/python2.7/site-packages/twisted/internet/epollreactor.py", line 24, in
from twisted.internet import posixbase
File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in
from twisted.internet import error, udp, tcp
File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 28, in
from twisted.internet._newtls import (
File "/usr/lib64/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/usr/lib64/python2.7/site-packages/twisted/protocols/tls.py", line 63, in
from twisted.internet._sslverify import _setAcceptableProtocols
File "/usr/lib64/python2.7/site-packages/twisted/internet/_sslverify.py", line 38, in
TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

ravitejar272 commented Sep 19, 2017

I am trying to use django channels on redhat and getting same error message. I tried to upgrade pyopenssl, twisted and yum upgrade also. I am still getting same error.

My environment:
python - 2.7.5
pip - 9.0.1
OpenSSL 17.3.0

Error:
File "/usr/lib/python2.7/site-packages/channels/management/commands/runserver.py", line 5, in
from daphne.server import Server, build_endpoint_description_strings
File "/usr/lib/python2.7/site-packages/daphne/server.py", line 8, in
from twisted.internet import reactor, defer
File "/usr/lib64/python2.7/site-packages/twisted/internet/reactor.py", line 38, in
from twisted.internet import default
File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 56, in
install = _getInstallFunction(platform)
File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 44, in _getInstallFunction
from twisted.internet.epollreactor import install
File "/usr/lib64/python2.7/site-packages/twisted/internet/epollreactor.py", line 24, in
from twisted.internet import posixbase
File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in
from twisted.internet import error, udp, tcp
File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 28, in
from twisted.internet._newtls import (
File "/usr/lib64/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/usr/lib64/python2.7/site-packages/twisted/protocols/tls.py", line 63, in
from twisted.internet._sslverify import _setAcceptableProtocols
File "/usr/lib64/python2.7/site-packages/twisted/internet/_sslverify.py", line 38, in
TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

@proofit404

This comment has been minimized.

Show comment
Hide comment
@proofit404

proofit404 Sep 20, 2017

Member

Hi. Check your twisted installation. I suspect you've missed some python package to install.

Member

proofit404 commented Sep 20, 2017

Hi. Check your twisted installation. I suspect you've missed some python package to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment