I'm encountering a super weird issue, where while using trino, the verify=False argument doesn't work when running in a separate python thread / process. When running the script directly, it works perfectly fine. But when My main program tries to execute this script, it throws SSL certificate verification failures.
The main program that wraps around this process will use python concurrent.futures to run the below python script.
run_trino.py (psuedo code)
import trino
query = "select * from database.table"
conn = trino.dbapi.connect(
host = host,
port = port,
http_scheme = "https",
catalog = "catalog",
verify = False
)
cur = conn.cursor()
cur.execute(query) # <- SSL exception is thrown when running from wrapper program.
rows = cur.fetchall()
I've inspected the objects to verify that verify is set: Both conn._http_session.verify and cur._connection._http_session.verify is set to False.
And again, running the script by itself, python3 run_trino.py will execute the query perfectly fine and return results. This only happens when running inside python's concurrent.futures wrapper.
Does python's SSL implementation use other values to determine if ssl verification should be enabled? Such as environment variables, kerberos or otherwise?