Json query 'certificate verify failed' on self signed certificate

I need to query an internal api which uses a self signed certificate.

i bump into a:

Error running query: HTTPSConnectionPool(host='MYINTERNALHOST', port=443): Max retries exceeded with url: /ovirt-engine/api/vms (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

the query looks like:

url: https://MYINTERNALHOST/ovirt-engine/api/vms
auth: [MYUSER, MYPASSWORD]
headers: [Accept: application/json]

Is there a was to force the library to trust the certificate (same behaviour as of ā€œcurl -kā€)

Although this doesnā€™t answer your question directly, if your internal host has a domain name in externally visible DNS (eg ā€œsomething.comā€, ā€œsomething.ioā€, etc), then you could potentially generate a valid Lets Encrypt certificate for it using DNS based authentication.

Thatā€™s how itā€™s commonly done for servers which arenā€™t reachable from the outside world.

Can give you the exact certbot commands to run for generating the certificate, if thatā€™d be useful. (?) :smile:

@justinclift thanks for your contribution. But i do not think it fits the bill in my case.

What I need is the merge of this pull request: Add verify option to JSON datasource runner to allow skipping certificate verification by kevinchiang Ā· Pull Request #5212 Ā· getredash/redash Ā· GitHub

@jesse any plan to merge #5112 Add verify option to JSON datasource runner to allow skipping certificate verification by kevinchiang Ā· Pull Request #5212 Ā· getredash/redash Ā· GitHub?

Interesting. That looks like a straight forward PR that should be easy to merge.

However it looks like the automatic build which is supposed to run and test submitted PRā€™s instead hung, and never reported back a status.

@jesse Are you able to give the build there a kick or something to restart it?

Bump.

Hi @justinclift or @jesse, can we give the automated build a kick for this one as Justin suggested?

1 Like

Thanks for pinging this! Since I donā€™t have permissions on your fork I canā€™t retrigger the actions run. Please run the following and push your changes to the PR branch:

git commit --allow-empty -m "trigger GitHub actions"
git push
2 Likes

The fix has now been merged. Thank you again!

1 Like