2

I am having an issue that is eerily similar to this post on SO. I cannot use the answer there because I am on Ubuntu, and brew is for Mac. When I try to launch my Django server, (python manage.py runsslserver) I get the following error:

AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'

I know I have OpenSSL installed for Python, as when I run import ssl and then print ssl.OPENSSL_VERSION in my Python environment, I get:

OpenSSL 1.0.1f 6 Jan 2014

There must be something really simple I am missing here. Any help at all is appreciated.

1 Answer 1

4

According to your question your are using Python 2.7.6. Looking at the documentation for ssl.PROTOCOL_TLSv1_2 you will see:

ssl.PROTOCOL_TLSv1_2
...Available only with openssl version 1.0.1+.
New in version 2.7.9.

Thus, you need at least version 2.7.9 of Python. Either you upgrade your system to get an newer version or get some pre-packaged newer Python version like Anaconda.

Sign up to request clarification or add additional context in comments.

3 Comments

I have python 2.7.6. How would I update to 2.7.9
@ifconfig: to cite the last sentence of my answer: "Either you upgrade your system to get an newer version or get some pre-packaged newer Python version like Anaconda".
Okay, I found it. PROTOCOL_TLSv1_2 has been deprecated since 2.7.13, it should be replaced with OP_NO_SSLv3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.