P.vasiliy Posted February 5, 2019 Share Posted February 5, 2019 (edited) Добрый вечер. Подскажите как избавится от ошибки. from urllib2 import urlopen print urlopen('https://ideone.com/plain/xdlcE7', timeout = 3).read() Traceback (most recent call last): File "scripts/client/game.py", line 156, in init File "scripts/client/gui/shared/personality.py", line 371, in init File "scripts/client/gui/mods/__init__.py", line 19, in init File "scripts/client/gui/mods/__init__.py", line 67, in _findValidMODs File "scripts/common/Lib/importlib/__init__.py", line 37, in import_module File "mod_test", line 4, in <module> File "scripts/common/Lib/urllib2.py", line 127, in urlopen File "scripts/common/Lib/urllib2.py", line 404, in open File "scripts/common/Lib/urllib2.py", line 422, in _open File "scripts/common/Lib/urllib2.py", line 382, in _call_chain File "scripts/common/Lib/urllib2.py", line 1222, in https_open File "scripts/common/BWAutoImport.py", line 78, in do_open URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure> В клиенте испольется Python версии 2.7.7rc1 Про эту ошибку пишут следущее: The server you are trying to reach requires (SNI) Server Name Indication and will cause a handshake failure if the client is not using this SNI extension. Support for SNI was only added with python 2.7.9 so it looks like you are out of luck. Т.е. нужен Python версии 2.7.9, которого в клиенте нет. Заранее благодарю за ответ С уважением, Василий. Edited February 5, 2019 by P.vasiliy @ Quote Link to comment Short link Share on other sites More sharing options...
SkepticalFox Posted February 5, 2019 Share Posted February 5, 2019 (edited) @P.vasiliy глянь в xvm - может поможет https://bitbucket.org/XVM/xvm/src/f450abb8350d183c37cd05ba7a7b1e60c9415499/src/xpm/xvm_main/loadurl.py?at=default&fileviewer=file-view-default Они раньше tlslite юзали - попробуй через него Edited February 5, 2019 by SkepticalFox @ Quote Link to comment Short link Share on other sites More sharing options...
P.vasiliy Posted February 5, 2019 Author Share Posted February 5, 2019 @SkepticalFox , что интересно до патча 1.4.0.0 все работало нормально. Ну и так к слову пример обращения: urlopen('https://static.modxvm.com/wn8-data-exp/json/wn8exp.json', timeout = 3).read() Проходит как и должен, без ошибок, хотя на XVM-ом сайте тоже защищенное соединение используется. А с ресурса - ideone.com urlopen('https://ideone.com/plain/xdlcE7', timeout = 3).read() Приводит к ошибке. @ Quote Link to comment Short link Share on other sites More sharing options...
POLIROID Posted February 8, 2019 Share Posted February 8, 2019 @P.vasiliy Описание ошибки довольно таки точное (тот текст на английском) Сервер CloudFlare (тот что проксирует) используют SNI для верефикации соеденения Ребята с XVM такую верификацию не используют Воспользуйтесь BigWorld.fetchURL(url, callback, [headers, timeout, method, postData]) Из бонусов кроме решения проблемы, он асинхронен (можно красиво обернуть в async и process) 1 @ Quote Link to comment Short link Share on other sites More sharing options...
ShuraBB Posted February 8, 2019 Share Posted February 8, 2019 51 минуту назад, POLIROID сказал: Воспользуйтесь BigWorld.fetchURL WL ругаться не будет? @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted February 9, 2019 Share Posted February 9, 2019 11 часов назад, ShuraBB сказал: WL ругаться не будет? нет, причем тут браузер :) @ Quote Link to comment Short link Share on other sites More sharing options...
Mixaill Posted May 26, 2019 Share Posted May 26, 2019 (edited) By the way, начиная с XFW.Native 1.4.3.0090 / XFW 7.9.4.1195 / XVM 7.9.4.9108 в клиент бэкпортируются HTTP и SSL стеки от CPython 2.7.16. То есть, начнёт работать и через urllib2, если дропнуть в клиент .wotmod с XFW.Native. Edited May 26, 2019 by Mixaill 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.