ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

GSKIT Error #989

Closed tonxxd closed 3 months ago

tonxxd commented 3 months ago

Please provide below information while opening an issue to understand your problem

For non-Windows system, output of below commands from terminal:

uname uname -m node -v npm ls ibm_db db2level echo $IBM_DB_HOME echo $PATH echo $LD_LIBRARY_PATH $DYLD_LIBRARY_PATH

Linux x86_64 v20.11.1 (node:50) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. (Use node --trace-warnings ... to show where the warning was created) flowpilot@0.1.0 /app `-- ibm_db@3.2.3

bash: db2level: command not found

Please provide below problem specific info:

=========================================

For Connection related issue

  1. Are you trying SSL connection or non-SSL connection? : SSL connection
  2. For SSL Connection, please read and follow this documentation : i found the link for gskit but does not seem to help
  3. For SSL connection, do you have ssl certificate from server? Yes
  4. If you have certificate, are you using SSLServerCertificate keyword in connection string or using your own keystore db? : SSLServerCertificate
  5. Share the connection string used for connection by masking password.

Hi I am getting this error when trying to connect to a db2 instance. I got the certificate from the user and i am trying to use this connection string DATABASE=USIBMVRDP2H;HOSTNAME=stfmvs1q.pok.ibm.com;UID=USER;PWD=xxx;PORT=5521;PROTOCOL=TCPIP;sslConnection=true;SSLServerCertificate=/uploads/9c65f730-623a-4650-af48-1223ce87243a;

where /uploads/9c65f730-623a-4650-af48-1223ce87243a is the certificate in jks format

It seems i can't find a lot of documentation online about the gskit library, do you think the error is a missing library in the docker build (and if yes how can i install it) or is it something else?

Thanks

bimalkjha commented 3 months ago

@tonxxd First of all, you have not read this documentation that talks about SSL connection and we have also mentioned it to check in point 2 of "For Connection Related Issues" on new issue template: https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md#SSLConnection

In this documentation, we have mentioned to use SECURITY=SSL; in connection string, but I don't see you are using it. ibm_db do not support JDBC driver keywords or any Java Key Store format certificate. It accepts certificates generated using GSKit only. Your connection string has two issues:

  1. Remove sslConnection=true; and use Security=SSL; instead.
  2. Value of SSLServerCertificate keyword must be full path a certificate generated for non-Java application on Db2 Server. It normally has .arm or .cert or .pem extension. ibm_db do not support jks format certificate. You need to get certificate generated using GSKit or .kdb and *.sth files. Thanks.
tonxxd commented 3 months ago

Hi @bimalkjha thanks for the quick reply. Sorry I actually use Security=SSL in the code, I copy pasted the snippet from the customer without changing it. I think the issue is definitely the certificate format then. I will ask them to give me the correct one. Since I don't see mentions of the non supported formats in the documentation in GitHub maybe is something that could be added for people like me that are not db experts. Thanks!

bimalkjha commented 3 months ago

Updated doc with info in latest release. Hence closing the issue now. Thanks.