SSL ERROR when placing api order

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)’)))

Hi there :waving_hand:,

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:

:one: Update Windows root certificates

certutil -generateSSTFromWU roots.sst

:two: Update Python SSL certificates

pip install --upgrade certifi

:three: Reinstall system certificate sync package

pip install --force-reinstall pip-system-certs

:four: Restart your terminal/IDE and try again.


:white_check_mark: This is a local certificate setup issue on Windows, not an Upstox API issue.

Once certificates are updated, the API request will work correctly.

Thanks,