Guilherme Marcondes
Guilherme Marcondes

Reputation: 51

How to Connect Db2 Luw from python using SSL

I am trying to connect the db2 mainframe from a python code and using ibm_db from MAC OS X

import ibm_db as db

conn = db.connect("DRIVER=/Users/guilhermemarcondes/Downloads/datavirtuality-jdbc_2.1.0.1.jar;DATABASE=DB2CPIDC;HOSTNAME=xxx;PORT=xxx;Security=SSL;SslServerCertificate=xxxxx/certreq.arm;PROTOCOL=TCPIP;UID=test;PWD=xxxx;", "", "")

cursor = conn.cursor()
cursor.execute("SELECT * FROM teste where iorder = 'B6040353' ")
for r in cursor.fetchall():
    print(r)

However when I try to run I get this error message :

Exception:

[IBM][CLI Driver] SQL10013N The specified library "GSKit Error: 2" could not be loaded. SQLSTATE=42724 SQLCODE=-10013

Could someone please help me ?

Thank so much

Upvotes: 1

Views: 919

Answers (1)

Roland Weber
Roland Weber

Reputation: 1965

Check the contents of your certificate file. It should have at least one section starting with

-----BEGIN CERTIFICATE-----

I got the same, unhelpful "GSKit Error: 2" when the contents of my certificate file was base64-encoded, so that GSKit couldn't load the certificate.

Upvotes: 0

Related Questions