Preparing for any type of Oracle Call Interface (OCI) connection with mTLS authentication requires the installation of client software, downloading client credentials, and configuring certain files and environment variables.
This topic covers the steps to prepare an application to connect using mTLS authentication with a wallet that you download from an Autonomous Database instance. See Prepare for Oracle Call Interface, ODBC, and JDBC OCI Connections Using TLS Authentication for information on the steps to prepare for TLS authentication with these connection types.
New Oracle Client Installation
The following steps assume Oracle client software has not
already been installed on the client computer. If Oracle client software has already been installed
and there are working copies of
tnsnames.ora, see Updating an Existing Oracle Client
Before making an Oracle Call Interface (OCI), ODBC, or JDBC OCI connection, do the following:
Install Oracle Client software on your computer.
Oracle Instant Client/Oracle Database Client: 18.19 (or later), 19.2 (or later), or 21 (base release or later). The Instant Client contains the minimal software needed to make an Oracle Call Interface connection.
Download client credentials and store the file in a secure folder on your client computer. See Download Client Credentials (Wallets).
Unzip/uncompress the credentials file into a secure folder on your client computer.
sqlnet.orafile in the folder where you unzip the credentials file, replacing
"?/network/admin"with the name of the folder containing the client credentials.
For example, edit
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="?/network/admin"))) SSL_SERVER_DN_MATCH=yes
The changed value on UNIX/Linux is:
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/home/adb_credentials"))) SSL_SERVER_DN_MATCH=yes
The changed value for Windows is:
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="D:\\myapp\\adb_credentials"))) SSL_SERVER_DN_MATCH=yes
TNS_ADMINenvironment variable and set it to the location of the credentials file.
Use this environment variable to change the directory path of Oracle Net Services configuration files from the default location of
ORACLE_HOME\network\adminto the location of the secure folder containing the credentials file you saved in Step 2. Set the
TNS_ADMINenvironment variable to the directory where the unzipped credentials files are, not to the credentials file itself.
For example, on UNIX/Linux set
TNS_ADMINto the full path of the directory where you unzipped the client credentials:
For example on Windows:
Connections with an HTTP Proxy
If the client is behind a firewall and your network configuration requires an HTTP
proxy to connect to the internet, then perform the following steps to update the
Connections through an HTTP proxy are only available with Oracle Client software
version 126.96.36.199 or later.
To avoid manual updates in
tnsnames.orafiles, you can use SQLcl and specify the HTTP proxy on the command line. See Connect Oracle SQLcl Cloud with a Wallet (mTLS) for more information.
Add the following line to the
sqlnet.orafile to enable connections through an HTTP proxy:
Add the HTTP proxy hostname and port to the connection definitions in
tnsnames.ora. You need to add the
https_proxy_portparameters in the address section of connection definitions. For example, the following sets the HTTP proxy to
proxyhostnameand the HTTP proxy port to
80; replace these values with your HTTP proxy information:
ADB1_high = (description= (address= (https_proxy=proxyhostname)(https_proxy_port=80)(protocol=tcps)(port=1522)(host=adb.example.oraclecloud.com) ) (connect_data=(service_name=adb1_high.adb.oraclecloud.com) ) (security=(ssl_server_dn_match=yes)) ) )
tnsnames.orafor the HTTP proxy may not be enough depending on your organization's network configuration and security policies. For example, some networks require a
passwordfor the HTTP proxy. In such cases contact your network administrator to open outbound connections to hosts in the oraclecloud.com domain using port 1522 without going through an HTTP proxy.
more information on
SQLNET.USE_HTTPS_PROXY, see Net Services
For information on
HTTPS_PROXY_PORT, see Protocol Address
Updating an Existing Oracle Client Installation
If you have an existing Oracle Client installation,
you already have
tnsnames.ora files and the
TNS_ADMIN environment variable. In this case, do the following:
sqlnet.orafile by adding the following:
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/home/adb_credentials")))
Copy the entries in the
tnsnames.orafile provided in the Autonomous Database wallet to your existing