SSLError : certificate verify failed: unable to get local issuer certificate (


  • for command -

    obj=SmartConnect(api_key=api_key)
    
    

    Im getting belo error -

    Traceback (most recent call last):
      File "d:/gitlab/one_algo/stock_market/statergy_trend/NSE/selection/scripts/broker_specific_tickers.py", line 175, in <module>
        total_amount = angel_broking.get_total_balance(broker_owner, logger)
      File "D:\gitlab\one_algo\support_functions\angel_broking.py", line 89, in get_total_balance
        data = obj.generateSession(user_id,password)
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\smartapi\smartConnect.py", line 244, in generateSession     
        loginResultObject=self._postRequest("api.login",params)
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\smartapi\smartConnect.py", line 236, in _postRequest        
        return self._request(route, "POST", params)
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\smartapi\smartConnect.py", line 196, in _request
        raise e
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\smartapi\smartConnect.py", line 185, in _request
        r = requests.request(method,
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\api.py", line 61, in request
        return session.request(method=method, url=url, **kwargs)
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 530, in request
        resp = self.send(prep, **send_kwargs)
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 643, in send
        r = adapter.send(request, **kwargs)
      File "C:\Users\keerthan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 514, in send
        raise SSLError(e, request=request)
    requests.exceptions.SSLError: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Max retries exceeded with url: /rest/auth/angelbroking/user/v1/loginByPassword (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable 
    to get local issuer certificate (_ssl.c:1123)')))
    PS D:\gitlab\one_algo>
    

  • HI @prateekjjw001 @daytrader @keer2405 Thank you for brining this to our notice. We were in the process of updating the certificate and rolled it back due to this error yesterday.


  • @daytrader - how to update the cache of certificates locally?
    @admin - can you resolve this issue today itself? I am sure lot of users will be unhappy if they face it on Monday.


  • @keer2405 @admin I was also getting same errors.
    I guess the certificates are not updated.

    So as a bypass - I have updated my local cache of certificates in the python installation.

    I had posted this issue in the morning when it suddenly started to happen

    https://smartapi.angelbroking.com/topic/177/not-able-to-login