Skip to content

Commit c74942d

Browse files
committed
doc update with SSL info for #989
1 parent 1149d38 commit c74942d

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

APIDocumentation.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,46 @@ connStr = "DATABASE=database;HOSTNAME=hostname;PORT=port;Security=SSL;SSLServerC
109109
```
110110
> Note the two extra keywords **Security** and **SSLServerCertificate** used in connection string. `SSLServerCertificate` should point to the SSL Certificate from server or an CA signed certificate. Also, `PORT` must be `SSL` port and not the TCPI/IP port. Make sure Db2 server is configured to accept connection on SSL port else `ibm_db` will throw SQL30081N error.
111111
112+
> `ibm_db` uses IBM ODBC/CLI Driver for connectivity and it do not support a certificate generated in `jks` format.
113+
`ibm_db` do not work with a `keystore.jks` file or any certificate generated for Java application. `ibm_db` works
114+
with a certificate generate for non-Java application that can get processed by GSKit tool. If you have a `*.jks` file,
115+
please get a SSL Certificate meant for non-Java application. If you have downloaded `IBMCertTrustStore` from IBM site,
116+
ibm_db will not work with it; you need to download `Secure Connection Certificates.zip` file that comes for IBM
117+
DB2 Command line tool(CLP).
118+
119+
> `ibm_db` supports only ODBC/CLI Driver keywords in connection string: https://www.ibm.com/docs/en/db2/11.5?topic=odbc-cliodbc-configuration-keywords
120+
121+
> Do not use keyworkds like `sslConnection=true` in connection string as it is a JDBC connection keyword and ibm_db
122+
ignores it. Corresponding ibm_db connection keyword for `sslConnection` is `Security` hence, use `Security=SSL;` in
123+
connection string instead.
124+
112125
To connect to dashDB in IBM Cloud, use below connection string:
113126
```
114127
connStr = "DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=passwd;Security=SSL";
115128
```
116129
> We just need to add **Security=SSL** in connection string to have a secure connection against Db2 server in IBM Cloud.
117130
131+
To connect a Db2 Server using SSL Certificate file, you can use connection string like below:
132+
```
133+
connStr = "DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=passwd;" +
134+
"Security=SSL;SSLServerCertificate=/home/user/myclientcert.arm;";
135+
```
136+
> Value of `SSLServerCertificate` keyword must be full path of a certificate generated for non-Java application on
137+
Db2 Server. It normally has `*.arm` or `*.cert` or `*.pem` extension. `ibm_db` do not support `jks` format
138+
certificate file.
139+
118140
You can also create a KeyStore DB using GSKit command line tool and use it in connection string along with other keywords as documented in [DB2 Infocenter](http://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0053518.html).
119141

142+
If you have created a KeyStore DB using GSKit using password or you have got *.kdb file with *.sth file, use
143+
connection string in below format:
144+
```
145+
connStr = "DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=dbuser;PWD=db2pwd;" +
146+
"Security=SSL;SslClientKeystoredb=C:/client.kdb;SSLClientKeystash=C:/client.sth;";
147+
OR,
148+
connStr = "DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=dbuser;PWD=db2pwd;" +
149+
"Security=SSL;SslClientKeystoredb=C:/client.kdb;SSLClientKeystoreDBPassword=kdbpasswd;";
150+
```
151+
120152
**Note:** You can also create keystoredb using GSKit and add certificate file to keystoredb to use as documented in [DB2 Infocenter](http://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.admin.sec.doc/doc/t0053518.html).
121153

122154
### <a name="openSyncApi"></a> 2) .openSync(connectionString [,options])

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Async APIs return promises if callback function is not used. Async APIs supports
1111

1212
- **SQL1598N Error** - It is expected in absence of valid db2connect license. Please click [here](#sql1598n) and read instructions.
1313

14+
- **GSKit Error** - Check instructions as documented [here](https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md#SSLConnection).
15+
1416
## API Documentation
1517

1618
- For complete list of ibm_db APIs and example, please check [APIDocumentation.md](https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md)
@@ -32,6 +34,9 @@ Install a newer compiler or upgrade older one.
3234

3335
- **For Docker Linux Container:** make sure you have installed **make, gcc, g++(gcc-c++), python3.9 and node** before installing `ibm_db`. For `root` user, use `npm install --unsafe-perm ibm_db` to install `ibm_db`.
3436

37+
- While installing `ibm_db` under a container, if you get libcrypt error, add a line in your scrip to install `libcrypt` and `libcrypt-compat` as this library is not present in most of the container OS. f.e. add a line like below in docker script:
38+
`RUN apt-get update && apt-get install gcc g++ libcrypt libcrypt-compat python3 make -y`
39+
3540
- **For Windows Subsystem for Linux (WSL):** Install `build-essentials` package before installing `ibm_db`.
3641

3742
- **For MacOS:** Install XCode from appstore before installing `ibm_db`. Also, gcc@8 and `make` is required.
@@ -373,6 +378,8 @@ To suppress this error, Db2 server must be activated with db2connectactivate uti
373378
374379
- Client side db2connect license is a `db2con*.lic` file that must be copied under `clidriver\license` directory.
375380
381+
- User running application must have write permission for `clidriver\cfgcache` and `clidriver\license` directories as clidriver need to create binary files to store licensing info in these directories at runtime. Lack of permission to create file too causes SQL1598N error.
382+
376383
- If you have a `db2jcc_license_cisuz.jar` file, it will not work for ibm_db. `db2jcc_license_cisuz.jar` is a db2connect license file for Java Driver. For non-Java Driver, client side db2connect license comes as a file name `db2con*.lic`.
377384
378385
- If environment variable `IBM_DB_HOME` or `IBM_DB_INSTALLER_URL` is not set, `ibm_db` automatically downloads [open source driver specific clidriver](https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/) from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli and save as `node_modules\ibm_db\installer\clidriver`. Ignores any other installation.

0 commit comments

Comments
 (0)