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

SSL: CERTIFICATE_VERIFY_FAILED #112

Closed
mayboy1234567 opened this issue May 10, 2024 · 2 comments
Closed

SSL: CERTIFICATE_VERIFY_FAILED #112

mayboy1234567 opened this issue May 10, 2024 · 2 comments

Comments

@mayboy1234567
Copy link

mayboy1234567 commented May 10, 2024

twstock.realtime.get一旦使用就會出現SSL認證錯誤,原本都是正常的,電腦都沒有變更過,也有試過另外一台電腦,狀況一樣,一台untuntu, 一台win 11.
只要twstock.realtime.get('2454')就能複製問題。

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)
...
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mis.twse.com.tw', port=443): Max retries exceeded with url: /stock/index.jsp (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))

twstock -U更新也會失敗:
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='isin.twse.com.tw', port=8443): Max retries exceeded with url: /isin/C_public.jsp?strMode=2 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x753a6aa1c2b0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

@AKKOU
Copy link

AKKOU commented May 10, 2024

+1 這邊也遇到一樣的問題,本來都運行的好好的,今天突然爆掉。
image

@boyu8266
Copy link

Code:

from twstock.realtime import get

data: dict = get(stock)

Error:

HTTPSConnectionPool(host='mis.twse.com.tw', port=443): Max retries exceeded with url: /stock/index.jsp (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))

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

3 participants