Module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'
See original GitHub issueHello,
I’m getting the following error. Running on Pyton 3.10.7, Selenium Wire 4.6.5 and pyOpenSSL 22.1.0. This log is from Heroku but I’m getting the same when running it locally. I’ve been using selenium-wire for over 2 years now and I never really had any issue that I couldn’t fix. However on this one I’m completely stuck. Any help would be greatly appreciated.
Traceback (most recent call last):
File "/app/deploy/dynos/link_update_1.py", line 2, in <module>
from script.link_update.bot import update_continuous
File "/app/script/link_update/bot.py", line 3, in <module>
from automation.bot.method import run_get_price_func
File "/app/automation/bot/method.py", line 10, in <module>
from automation.bot.method_search import auto_search_ddg_url
File "/app/automation/bot/method_search.py", line 10, in <module>
from libs.webscraper.webscraper import WSNavigate
File "/app/libs/webscraper/webscraper.py", line 11, in <module>
from seleniumwire.webdriver import Chrome
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/webdriver.py", line 27, in <module>
from seleniumwire import backend, utils
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/backend.py", line 4, in <module>
from seleniumwire.server import MitmProxy
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/server.py", line 5, in <module>
from seleniumwire.handler import InterceptRequestHandler
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/handler.py", line 5, in <module>
from seleniumwire import har
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/har.py", line 11, in <module>
from seleniumwire.thirdparty.mitmproxy import connections
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/thirdparty/mitmproxy/connections.py", line 10, in <module>
from seleniumwire.thirdparty.mitmproxy.net import tls, tcp
File "/app/.heroku/python/lib/python3.10/site-packages/seleniumwire/thirdparty/mitmproxy/net/tls.py", line 43, in <module>
"SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS),
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?
Update After forking and removing 4 lines it seems to work. However I’m not sure what I’m doing. Any help would still be appreciated. https://github.com/stan5079/selenium-wire/commit/645ce6a16ba7a4cf5ba396890125b5b3e3feb5b9
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
module 'OpenSSL.SSL' has no attribute 'SSLv3_METHOD ...
After running the scrapy shell with the defined url, I am getting the attribute error showing the following error: AttributeError ...
Read more >module 'OpenSSL.SSL' has no attribute 'SSL_ST_INIT' · Issue ...
I have a regression when trying to import all symbols from OpenSSL.SSL Python 3.6.4 cryptography: 2.1.4-1 cffi: 1.11.4-1 OpenSSL 1.1.0.g-1 ...
Read more >module 'OpenSSL.SSL' has no attribute 'SSLv23_METHOD'
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv23_METHOD' ... I found this page https://stackoverflow.com/questions/432 ... sl-st-init ...
Read more >SSL — An interface to the SSL-specific parts of OpenSSL
This module handles things specific to SSL. There are two objects defined: Context, Connection. OpenSSL.SSL. TLS_METHOD ¶; OpenSSL.SSL.
Read more >List of issues - Python tracker
This issue tracker has been migrated to GitHub, and is currently read-only. ... _ssl module doesn't compile with OpenSSL 1.0.0d: SSLv2_method is missing ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A fix is included in the latest version of Selenium Wire -
5.0.0
Thanks for raising this.
The issue appears to be caused by a new version of PyOpenSSL 22.1.0 that was released yesterday (September 25th). It looks like that version contains a backwards incompatible API change that breaks Selenium Wire.
I’ll update Selenium Wire so that it doesn’t depend on this version, but in the meantime you should hopefully be able to work around the problem by using version 22.0.0 of PyOpenSSL. You can explicitly install that into your environment with: