python api client SSL ERROR
leotis
Registered Posts: 4 ✭✭✭✭
I am getting the following error while trying to connect to the automation node using the python api client
requests.exceptions.SSLError: HTTPSConnectionPool(host='dataiku-auto.fg.rbc.com', port=443): Max retries exceeded with url: /dip/publicapi/projects/card_engagement_class/scenarios/scheduled_partition/run (Ca\
used by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))
How can I fix this, can I tell the api client not to perform and ssl check?
Answers
-
This error comes from the SSL setup of your automation node. You will need to fix it to prevent the requests package from complaining.
Alternatively, you can also pass verify=False to your get call, that will skip verification of SSL certificates, although I cannot recommend it as a proper solution... Since that kind of defeats the point of having HTTPS on your node.
If your certificate is self signed, you can also pass a cert file to your get call, you'll find more information in the documentation of the requests package.
Hope I'm not missing something, please provide more context so I can help further if this answer isn't satisfying. -
Hi,
I am using the rest-api client (see here https://doc.dataiku.com/dss/latest/python-api/rest-api-client/index.html)
I read the source code for the rest-api client, it is using the python requests package (see https://pypi.org/project/requests/). I thought of adding the verify=False, however the rest-api client does not allow this.
1- Can you say how to setup SSL for our automation node.
2- Can you say how I can set verify= False for the api-client, I checked the documentation, but is does not seem to support that parameter.
Thanks -
Hi,
Thanks for the details, sorry my answer was not really fitting for your use case then!
1. I can't help here I think, except by pointing you to the documentation https://doc.dataiku.com/dss/latest/installation/custom_install.html#configuring-https
2. There is indeed an option to disable SSL checks, sorry that I didn't understand straight away. Here is the link https://doc.dataiku.com/dss/latest/python-api/outside-usage.html#disabling-ssl-certificate-check -
Great,
I tried downloading the dataiku api from here http(s)://DSS_HOST:DSS_PORT/public/packages/dataiku-internal-client.tar.gz
But it is not available. Is there another place I can obtain this file. -
What version of DSS are you using?
-
5.0.4
-
This is only possible since version 5.1.0 unfortunately
-
I submitted your issue to other members of the team and here is the proper answer:
- to use the dataikuapi package outside of DSS you need to add the root authority that signed the DSS SSL certificate to your local trust store.
- you can also disable checking the SSL certificate by setting
client._session.verify = False -
See my other answer that should solve your problem, this information will be added in our documentation
-
Thank you! This works!