I am trying to connect to NZ db from python using NZPY.
conn = nzpy.connect(user="DEV_USR", host="bac-nettezza", port =5480,database="DEV",securityLevel=1,logLevel=0)
with conn.cursor() as cursor:
try:
cursor.execute("select * from DEV.DEV_USR.abc")
except Exception as e:
print(str(e))
This gives me
File "/usr/local/lib/python3.6/site-packages/nzpy/__init__.py", line 50, in connect
application_name, max_prepared_statements, datestyle, logLevel, tcp_keepalive,char_varchar_encoding, logOptions, pgOptions)
File "/usr/local/lib/python3.6/site-packages/nzpy/core.py", line 1538, in __init__
raise ProgrammingError("Error in handshake")
nzpy.core.ProgrammingError: Error in handshake
The user is able to connect to NZ from unix without a password (that was the decision made so we don't have to provide password in the script).
Please suggest what can be done here. TIA
Netezza connection is TLS secured by default. This error is coming for the securityLevel 1 which represent
Only Unsecured sessioncausing the handshake error.You can use a secured securityLevel like 0,2,3. Security levels used in nzpy are listed below.
0: Preferred Unsecured session
1: Only Unsecured session
2: Preferred Secured session
3: Only Secured session