What is the root cause of this error code : ERROR!!! Authentication handler failed to request a acc

“refinitiv.dataplatform.errors.PlatformSessionError: Error code -1 | ERROR!!! Authentication handler failed to request a access token.

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)”

Best Answer

  • pf
    pf
    Answer ✓

    @asli.sahin

    Another cause of error could be due to a proxy server that blocks request to Internet.

    To fix this cause, you need to declare global environment variables HTTP_PROXY and HTTPS_PROXY with the url/ip address of your proxy server:


    set HTTPS_PROXY=https://proxy_ip:proxy_portset HTTP_PROXY=http://proxy_ip:proxy_port

    It could be authentified proxy, then you'll need to set with this way:


    set HTTPS_PROXY=https://proxy_userid:proxy_password@proxy_ip:proxy_portset HTTP_PROXY=http://proxy_userid:proxy_password@proxy_ip:proxy_port

Answers

  • Hi @asli.sahin,

    We need more information on your environment but it seems you have a self signed certificate or enterprise certificate that blocks requests. If this is confirmed, so the "[SSL: CERTIFICATE_VERIFY_FAILED]" error can't be fixed in the python lib but in your environment.

    This is the normal error message when the certificates authorities are not yet correctly setup. It could be a variety of factors to check.

    1. First, you need to verify if your environment needs a cerficate to send requests to Refinitiv platform, then identify this certificate (the file *.perm shoudl be somewhere but you can check
    2. To now where Python gets certificates, run this command line:
    > pip install certifi
    ...
    > python -c "import certifi; print(certifi.where())"
    C:\Users\Uxxxxxxxx\AppData\Local\.certifi\cacert.pem

    => python relies only on this cacert.pem file to manage certificates (all others cannot be found)

    3. Your certificate has to be added in this cacert.pem file.
    You can check this with your IT how to add it or by yourself manually (copy/paste the text "-----BEGIN CERTIFICATE----- xxxxxxxxxxxxxxxxxx -----END CERTIFICATE-----" from your certificate into cacert.pem)