Skip to content
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

获取行情快照,报错SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small #48

Closed
wk240 opened this issue May 11, 2022 · 2 comments

Comments

@wk240
Copy link

wk240 commented May 11, 2022

调用该接口 ef.stock.get_quote_snapshot(bond_code),报以下错误,请问大佬如何解决

File "F:\Programs\Python\Python310\lib\site-packages\decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "F:\Programs\Python\Python310\lib\site-packages\retry\api.py", line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File "F:\Programs\Python\Python310\lib\site-packages\retry\api.py", line 33, in __retry_internal return f() File "F:\Programs\Python\Python310\lib\site-packages\efinance\stock\getter.py", line 1335, in get_quote_snapshot response = requests.get( File "F:\Programs\Python\Python310\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, **kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "F:\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='hsmarketwg.eastmoney.com', port=443): Max retries exceeded with url: /api/SHSZQuoteSnapshot?id=123120&callback=jQuery183026310160411569883_1646052793441 (Caused by SSLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:997)')))

@Micro-sheep
Copy link
Owner

把 efinance 更新到最新版本(0.4.4)或者不要使用 python3.10 及其以上的版本即可。

@wk240
Copy link
Author

wk240 commented May 11, 2022

更新最新版本已解决!多谢大佬!ong

@wk240 wk240 closed this as completed May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants