Hi,
python ibm_db uses db2 ODBC and CLI driver(aka db2 clidriver) for connectivity to database. Hence, the connection string or configuration parameters that are supported in db2 clidriver are applicable for ibm_db as well.
You can configure client and generate certificates. Follow ->
clidriver by default will have a DigiCertGlobalRootCA.arm under cfg folder and can be used for SSL connections to dashdb and SQLDB databases.
You can specify "security=SSL;sslservercertificate=<path to cfg folder of clidriver installation/DigiCertGlobalRootCA.arm>;" in the connection string.
sslservercertificate can also contain the server certificate created and extracted by you.
example:
conn=ibm_db.connect('database=testpy;security=ssl;sslservercertificate=C:\Users\skauser\Documents\CLI\SSL\testpy_client_ssl\server.arm;protocol=tcpip;hostname=hostnameofyourmachine;port=sslport;uid=db2admin;pwd=XXXXXX;','','')
Try and let me know if you face any issues.
Thanks,
Saba.