Connect Liquibase to Oracle Database with SSL/TLS
Last updated: March 24, 2026
This procedure configures Liquibase to connect to Oracle Database over TCPS (SSL/TLS), encrypting traffic between the client and server on port 2484. Server-side configuration—including the Oracle listener and server wallet—must be completed by your Oracle DBA before you begin. The client wallet stores the server’s trusted certificate.
Before you begin
Install Liquibase
Ensure Java is installed.
Install Oracle Client Tools (included with Oracle Database, Oracle Instant Client, or Oracle Database Client) to obtain the
orapkiutility used in this procedure.Ask your Oracle DBA to configure the server listener for TCPS on port 2484 and provide you with the server’s certificate (in PEM or DER format) and the server certificate’s distinguished name (DN).
Procedure
Download Oracle JDBC drivers
All JARs are available from the Oracle JDBC Downloads page and Maven Central. Replace 21.13.0.0 with the latest 21.x release.
Download the following JARs from the Oracle JDBC Downloads page and place them in your lib/ directory.
ojdbc11.jaroraclepki.jarosdt_core.jarosdt_cert.jar
Create server wallet directory
Create the server wallet directory on your Oracle Database server. Be sure to:
Replace
/path/to/oraclewith your actualORACLE_HOMEpath.Replace
ORCLwith your Oracle SID.
Generate server certificate
Create an auto-login wallet and generate a self-signed certificate.
Be sure to:
Replace
your-server.example.comwith your Oracle server hostname. For example,db.company.com,oracle.example.org.Replace
YourOrgandUSwith your organization and country.Use a certificate from a trusted CA instead of self-signed for production environments.
Export server certificate
Export the server certificate to share with Liquibase clients.
Be sure to:
Replace
your-server.example.comwith your Oracle server hostname.Provide
/tmp/server_cert.pemto the Liquibase client viascpor your organization's secure file transfer process.
Configure listener.ora
Add SSL/TLS listener configuration to $ORACLE_HOME/network/admin/listener.ora. Be sure to:
Replace
$ORACLE_HOME/network/admin/wallet_serverwith the actual path to your server wallet directory.
Configure server sqlnet.ora
Add SSL/TLS configuration to $ORACLE_HOME/network/admin/sqlnet.ora.
Be sure to:
Replace
$ORACLE_HOME/network/admin/wallet_serverwith the actual path to your server wallet directory.Use modern TLS 1.2+ ciphers for JDBC compatibility.
Avoid older SSL 3.0 ciphers (
SSL_RSA_WITH_3DES_EDE_CBC_SHA).For Java/JDBC clients, prefer GCM ciphers. For example,
TLS_RSA_WITH_AES_256_GCM_SHA384.
Restart and verify Oracle listener
Restart the Oracle listener to apply the SSL/TLS configuration.
Look for (PROTOCOL=tcps)(HOST=0.0.0.0)(PORT=2484) in the output. This confirms the SSL listener is active.
Optionally, test the SSL handshake with OpenSSL.
Be sure to:
Replace
your-server.example.comwith your Oracle server hostname.
# Test SSL handshake (optional but recommended)
openssl s_client -connect your-server.example.com:2484 -showcertsCreate the client wallet
Create the client wallet directory and copy the server certificate from the Oracle server.
mkdir -p ~/liquibase-sslCopy the server certificate from the Oracle server to your client machine.
Be sure to:
Replace
your_oracle_userwith your Oracle server OS user. For example,oracle,opcReplace
your_oracle_serverwith the Oracle server hostname or IP.
scp your_oracle_user@your_oracle_server:/tmp/server_cert.pem ~/liquibase-ssl/Create the auto-login wallet.
orapki wallet create -wallet ~/liquibase-ssl -auto_login_onlyAdd the server certificate as a trusted root.
Verify the wallet contains the trusted certificate.
orapki wallet display -wallet ~/liquibase-sslAdd database credentials to wallet
Add your database credentials to the wallet so Liquibase can connect without a username or password in the connection string.
Be sure to:
Replace
your_tns_aliaswith the TNS alias fromtnsnames.ora. For example,MYDB_SSLReplace
your_usernamewith your database username.Replace
your_passwordwith your database password.
mkstore -wrl ~/liquibase-ssl \
-createCredential your_tns_alias your_username your_passwordVerify the credentials were stored successfully.
mkstore -wrl ~/liquibase-ssl -listCredentialDownload Oracle JDBC drivers
Download the Oracle JDBC and PKI JARs to your Liquibase lib/ directory. Replace 21.13.0.0 with the latest 21.x release.
Download the following JARs from the Oracle JDBC Downloads page and place them in your Liquibase lib/ directory.
ojdbc11.jaroraclepki.jarosdt_core.jarosdt_cert.jar
Create tnsnames.ora
Create tnsnames.ora in your ~/liquibase-ssl/config/ directory. Be sure to:
Replace
your-server.example.comwith your Oracle server hostname.Replace
ORCLwith your service name.Replace
CN=your-server.example.com,O=YourOrg,C=USwith your server certificate's distinguished name.
Create sqlnet.ora
Create sqlnet.ora in your wallet directory.
Be sure to:
Replace
your_wallet_dirwith the absolute path to your wallet directory. For example,/home/user/liquibase-ssl,/Users/name/liquibase-ssl
Configure JDBC properties
Create ojdbc.properties in your wallet directory.
Be sure to:
Replace
your_wallet_dirwith the absolute path to your wallet directory. For example,/home/user/liquibase-ssl,/Users/name/liquibase-ssl
oracle.net.tns_admin=your_wallet_dir
oracle.net.wallet_location=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=your_wallet_dir)))Configure Liquibase
Create or update liquibase.properties. Use the TCPS TNS alias and include the PKI JARs on the classpath. No username or password is needed, because the credentials come from the wallet.
Be sure to:
Replace
your_tns_aliaswith your TNS alias from tnsnames.ora. For example,MYDB_SSL,PROD_SSLReplace
your_lib_path/with your absolute path to your JAR files directory. For example,/home/user/liquibase-ssl/lib/,/Users/name/liquibase-ssl/lib/
Create sample changelog
Create ~/liquibase-ssl/changelog.xml.
Copy ojdbc.properties to root
Copy ojdbc.properties to the root directory so the JDBC driver can find it automatically.
cp ~/liquibase-ssl/config/ojdbc.properties ~/liquibase-ssl/This allows the JDBC driver to discover TNS_ADMIN and wallet locations.
Set environment variables
Set the following environment variables before running Liquibase.
Test your setup
Test 1: Verify Folder Structure
cd ~/liquibase-ssl
tree -L 2Expected structure:
Test 2: Test SSL Port Connectivity
Be sure to:
Replace
your-server.example.comwith your Oracle server hostname.
Expected: Connection succeeds.
Test 3: Test SSL Handshake
Be sure to:
Replace
your-server.example.comwith your Oracle server hostname.
openssl s_client -connect your-server.example.com:2484 -showcertsExpected output (press Ctrl+C to exit):
Test 4: Verify Wallet Contents
Expected:
Trusted certificate listed
MYDB_SSLcredential listed
Test 5: Test Liquibase Connection
Expected output:
Database is up to date
No changesets to deploy
Liquibase command 'status' was executed successfully.Test 6: Apply Changes
Expected:
Table created successfully
"Database is up to date"
Test 7: Verify Encryption
Connect to the database and check the session.
Expected output should include:
TCP/IP with SSL/TLS
AES256 Encryption service adapter
SHA256 Crypto-checksumming service