After fresh installation of windows 10, I am getting the below error when placing orders through api
I have already installed “pip install pip-system-certs”, but the error still there. please assist.
Error: HTTPSConnectionPool(host=‘api-hft.upstox.com’, port=443): Max retries exceeded with url: /v3/order/place (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)’)))
This error occurs because your Windows system is missing required SSL root certificates after a fresh installation.
As a result, Python is unable to verify the HTTPS certificate when calling the Upstox API.
Please follow the steps below to fix it:
Update Windows root certificates
certutil -generateSSTFromWU roots.sst
Update Python SSL certificates
pip install --upgrade certifi
Reinstall system certificate sync package
pip install --force-reinstall pip-system-certs
Restart your terminal/IDE and try again.
This is a local certificate setup issue on Windows, not an Upstox API issue.
Once certificates are updated, the API request will work correctly.