Skip to Main Content

Programming Languages & Frameworks

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

TLS connection to Oracle DB using node-oracledb with PEM file

ckantzerApr 25 2024 — edited Apr 25 2024

Hello,

I'm trying to connect to Oracle 19c using node-oracledb in thin mode using a PEM file. However, the PEM file my DBA's provided does not have a password associated with it.

My config is below:

config = {
            connectString,
            user,
            password,
            configDir,
            walletLocation,
            walletPassword
        };

where connectString is the tnsnames.ora alias, configDir is the location of the tnsnames.ora file and walletLocation is the location of the PEM file.

No matter what I put for walletPassword ("", “ ”, “NONE” or removing the walletPassword param altogether) I get the following error when executing a query

[Oracle executeQuery] Error: NJS-505: unable to initiate TLS connection. Please check if wallet credentials are valid

From the logs it looks like creating the pool is successful.

If I update the tnsnames.ora to use the standard non TLS port I'm able to connect and execute a query.

Does node-oracledb in thin mode support TLS connections with a PEM that does not have a password? Is this an issue with my config or a setup issue with Oracle 19c?

node-oracledb version:

"oracledb": "^6.0",

Thanks!

This post has been answered by ckantzer on May 16 2024
Jump to Answer

Comments

Add EVENT_10842=15

You can also set this as an environment variable with the same name & value.

Sheeraz Majeed May 10 2024 — edited on May 10 2024

Hi, Thanks for reply.

But still no trace or log files to check used oci functions

Works for me.

cjones@cjones-mac:~$ rm -rf $HOME/instantclient/log/diag/clients && mkdir -p $HOME/instantclient/log/diag/clients
cjones@cjones-mac:~$ export EVENT_10842=15
cjones@cjones-mac:~$ sqlplus cj/cj@localhost/orclpdb1

...

SQL> select * from dual;

D
-
X

SQL> exit

And then a file like /Users/cjones/instantclient/log/diag/clients/user_cjones/host_nnnnnn_nn/trace/ora_nnn_nnnnn.trc will contain lines like:

# 2024-06-06 07:26:54.520 # Thread ID 8547126272 # Entry - OCIServerAttach(srvhp = 0x128030068, errhp = 0x13580a410, dblink_hash = H:0x9bf0f8e9ee161fdf, mode = OCI_DEFAULT(000000000), dblink = localhost/orclpdb1, dblink_len = 18 );
1 - 3

Post Details

Added on Apr 25 2024
3 comments
1,056 views