Connect Node.js and other Scripting Languages (mTLS)

You can use programs in different languages, including Python, Node.js, PHP, Ruby, R, Go, and Perl to connect to an Autonomous Database instance using mTLS (with wallets). Security is enforced using client credentials.

These scripting languages have database access APIs or drivers that use the Oracle Call Interface libraries.


Oracle Call Interface (OCI) clients support mTLS authentication with a wallet if you are connecting using the following client versions:
  • Oracle Instant Client/Oracle Database Client: 18.19 (or later), 19.2 (or later), or 21 (base release or later).

For details on connecting Node.js or other scripting laguages without a wallet, see Connect Node.js, and Other Scripting Languages Without a Wallet.

For additional details, see the following video:

Install the Language Driver and Client Libraries

To connect to Autonomous Database from your scripting language, first install the language driver and client libraries as follows:

  1. Install Oracle Instant Client/Oracle Database Client: 18.19 (or later), 19.2 (or later), or 21 (base release or later).

    The Instant Client works well for most applications. To install the Instant Client do the following:

    1. Select your desired architecture from the Instant Client Downloads page and download a Basic Package (available on the download page): Oracle Instant Client Downloads.

      Alternatively download the Basic Light Package from the download page for your desired architecture if the Basic Light globalization limitations suit your use.

    2. If you are building a language API or driver from source code, you may also need to download the Instant Client SDK: Oracle Instant Client

    3. Unzip the base package you selected. For example unzip to C:\instantclient_12_2 or /home/myuser/instantclient_18_5. If you also download the SDK, unzip it in the same directory.

    4. On Windows, add the path to the PATH variable in the "System variables" section of the Environment Variables pane (for example add C:\instantclient_12_2). On Windows 8 access the PATH variable setting area by navigating to Control Panel>System>Advanced System Settings>Environment Variables. If you have multiple versions of Oracle libraries installed make sure the new directory occurs first in the path.

    5. On non-Windows platforms, create a symbolic link if it does not exist. For example:

      cd /home/myuser/instantclient_18_5
      ln -s

      If there is no other Oracle software on your system that will be impacted, add Instant Client to the runtime link path. For example:

      sudo sh -c "echo /home/myuser/instantclient_18_5 > /etc/"
      sudo ldconfig

      Alternatively set the library path in each shell that runs your application. For example:

      export LD_LIBRARY_PATH=/home/myuser/instantclient_18_5:$LD_LIBRARY_PATH

      The Linux Instant Client download files are available as .zip files or .rpm files. You can use either version.
  2. Install the relevant language driver for Oracle Database:

Enable Oracle Network Connectivity and Obtain the Security Credentials (Oracle Wallet)

  1. Obtain client security credentials to connect to Autonomous Database. You obtain a zip file containing client security credentials and network configuration settings required to access your database. You must protect this file and its contents to prevent unauthorized database access. Obtain the client security credentials file as follows:

    • ADMIN user: Click Database connection. See Download Client Credentials (Wallets).

    • Other user (non-administrator): Obtain the Oracle Wallet from the administrator for your Autonomous Database.

  2. Extract the client credentials (wallet) files:

    1. Unzip the client credentials zip file.

    2. If you are using Instant Client, make a network/admin subdirectory hierarchy under the Instant Client directory if necessary. Then move the files to this subdirectory. For example depending on the architecture or your client system and where you installed Instant Client, the files should be in the directory:





      • If you are using a full Oracle Client move the file to $ORACLE_HOME/network/admin.

    3. Alternatively, put the unzipped wallet files in a secure directory and set the TNS_ADMIN environment variable to that directory name.


    From the zip file, only these files are required: tnsnames.ora, sqlnet.ora, cwallet.sso, and ewallet.p12.
  3. If you are behind a proxy follow the steps in “Connections with an HTTP Proxy”, in Prepare for Oracle Call Interface, ODBC, and JDBC OCI Connections with Wallets (mTLS).

Run Your Application

  1. Update your application to connect using your database username, your password, and the Oracle Net connect name given in the unzipped tnsnames.ora file. For example, user, adb_user, password, and db2022adb_low as the connect string.

  2. Alternatively, change the connect string in tnsnames.ora to match the string used by your application.

  3. Run your application.