Enabling Encryption in JDBC Connect Strings

To enable client encryption and integrity checking in a JDBC connect string, use the following syntax:

jdbc:oracle:thin:@//hostname:1521/hrdb ?oracle.net.encryption_client=REQUIRED
&oracle.net.encryption_types_client=AES256
&oracle.net.crypto_checksum_client=REQUIRED
&oracle.net.crypto_checksum_types_client=SHA1

Once you are connected, run the following sql to verify the settings. Look for lines that list ciphers and contain the words “service adapter”. Ignore the other lines. This tells us that encryption and/or integrity checking is active for the connection.

select sid, network_service_banner
from v$session_connect_info
where sid = sys_context('USERENV','SID');

SID NETWORK_SERVICE_BANNER
--- --------------------------------------------------
247 TCP/IP NT Protocol Adapter for: Version 19.0.0.0.0
247 Encryption service for: Version 19.0.0.0.0
247 AES256 Encryption service adapter for: Version 19.0.0.0.0
247 Crypto-checksumming service for: Version 19.0.0.0.0
247 SHA1 Crypto-checksumming service adapter for: Version 19.0.0.0.0

This entry was posted in Uncategorized. Bookmark the permalink.