Twisted 17.1.0 tls fails on python 2.7.5 due missing OP_NO_TLSv1_1
Open
Nobody has claimed this yet.
bug
core
new
priority-normal
- Dominant language
- Python
- Stars
- 6k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 10
Description
| @noc0lour reported | |
|---|---|
| Trac ID | trac#9121 |
| Type | defect |
| Created | 2017-04-25 17:36:24Z |
I'm trying to run a twisted application on a CentOS7 container with necessary deps installed.
All deps are istalled from the official CentOS7 repo
- OpenSSL version: 1.0.1e
- Python version: 2.7.5
If I downgrade to Twisted 16.0.0 everything works fine.
[buildbot@86134cdfec09 buildbot]$ twistd -ny buildbot.tac
Unhandled Error
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 662, in run
runApp(config)
File "/usr/lib64/python2.7/site-packages/twisted/scripts/twistd.py", line 25, in runApp
_SomeApplicationRunner(config).run()
File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 380, in run
self.application = self.createOrGetApplication()
File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 445, in createOrGetApplication
application = getApplication(self.config, passphrase)
--- <exception caught here> ---
File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 456, in getApplication
application = service.loadApplication(filename, style, passphrase)
File "/usr/lib64/python2.7/site-packages/twisted/application/service.py", line 413, in loadApplication
passphrase)
File "/usr/lib64/python2.7/site-packages/twisted/persisted/sob.py", line 223, in loadValueFromFile
eval(codeObj, d, d)
File "buildbot.tac", line 9, in <module>
from buildbot_worker.bot import Worker
File "/usr/lib/python2.7/site-packages/buildbot_worker/bot.py", line 19, in <module>
from buildbot_worker.null import LocalWorker
File "/usr/lib/python2.7/site-packages/buildbot_worker/null.py", line 21, in <module>
from buildbot_worker.base import WorkerBase
File "/usr/lib/python2.7/site-packages/buildbot_worker/base.py", line 26, in <module>
from twisted.internet import reactor
File "/usr/lib64/python2.7/site-packages/twisted/internet/reactor.py", line 38, in <module>
from twisted.internet import default
File "/usr/lib64/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
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 <module>
from twisted.internet import posixbase
File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in <module>
from twisted.internet import error, udp, tcp
File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 28, in <module>
from twisted.internet._newtls import (
File "/usr/lib64/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/usr/lib64/python2.7/site-packages/twisted/protocols/tls.py", line 63, in <module>
from twisted.internet._sslverify import _setAcceptableProtocols
File "/usr/lib64/python2.7/site-packages/twisted/internet/_sslverify.py", line 38, in <module>
TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
exceptions.AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
Failed to load application: 'module' object has no attribute 'OP_NO_TLSv1_1'
Searchable metadata
trac-id__9121 9121
type__defect defect
reporter__noc0lour noc0lour
priority__normal normal
milestone__None None
branch__
branch_author__
status__new new
resolution__None None
component__core core
keywords__None None
time__1493141784860374 1493141784860374
changetime__1495562062302269 1495562062302269
version__None None
owner__None None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in twisted/internet/_sslverify.py at the TLSVersion mapping that references SSL.OP_NO_TLSv1_1, and reproduce the import failure with Python 2.7.5 and OpenSSL 1.0.1e. Trace the TLS setup path from twisted/internet/tcp.py and confirm that Twisted starts and configures TLS without raising the missing-attribute error on the affected environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100