UniDAC

Connecting to Oracle Through SSL in Delphi

Secure Sockets Layer (SSL) is an industry-standard protocol for secure access to a remote machine over untrusted networks. It runs on top of TCP/IP to secure client-server communications by allowing SSL-enabled clients and servers to authenticate each other.

During server authentication, an SSL-enabled client application uses standard public-key cryptography techniques to verify the server's identity by checking that the server's certificate was issued by a trusted Certificate Authority (CA) and proves the ownership of the public key. SSL also supports client authentication, allowing the server to verify the client's identity.

After establishing an SSL connection, the client and server can exchange messages that are symmetrically encrypted using the shared secret key. SSL is the recommended method for establishing a secure connection to Oracle because it is easier to configure and performs better than SSH.

You can establish a secure connection to an Oracle server using SecureBridge, a solution provided by Devart. It allows you to embed an SSL client into a Delphi or C++ Builder application.

This page demonstrates how to connect a client application to Oracle using UniDAC with SSL as the encryption method.

Connect using an Oracle wallet

Prerequisites:

An Oracle wallet is a container for storing authentication and signing credentials, including certificates and keys needed by SSL. For information on creating and obtaining an Oracle wallet, see the official documentation for Oracle Database or Oracle Cloud.

  1. In RAD Studio, select File > New > Windows VCL Application - Delphi.
  2. The extended File menu and New submenu in Delphi.

  3. Place the following components from the Palette on the form:
    • TDBGrid
    • TButton
    • TCRSSLIOHandler
    • TOracleUniProvider
    • TUniConnection
    • TCRSsoFileStorage
    • TUniQuery
    • TUniDataSource
  4. Components added to the form for an SSL connection to Oracle in Delphi.

  5. Select the TUniConnection component and, in the Object Inspector, set the IOHandler property to the instance of TCRSSLIOHandler (CRSSLIOHandler1).
  6. The TCRSSLIOHandler component assigned to the IOHandler property in the TUniConnection component in the Object Inspector.

  7. Double-click the TUniConnection component.
  8. On the Options tab, fill out the fields:
    • Provider – Select Oracle.
    • Direct – Select True.

    UniConnection options for the Oracle provider in Delphi.

  9. On the Connect tab, fill out the fields:
  10. Click Connect to test the connection to the Oracle server, then click OK to close the dialog.
  11. Connection to Oracle in Delphi.

  12. Select the TDBGrid component and set the DataSource property to the instance of TUniDataSource (UniDataSource1).
  13. The TUniDataSource component assigned to the DataSource property in the TDBGrid component in the Object Inspector.

  14. Select the TUniDataSource component and set the DataSet property to the instance of TUniQuery (UniQuery1).
  15. The TUniQuery component assigned to the DataSet property in the TUniDataSource component in the Object Inspector.

  16. Select the TCRSsoFileStorage component and specify the path to the Oracle wallet file in the Path property.
  17. The path to the Oracle wallet file specified in the TCRSsoFileStorage component in the Object Inspector.

  18. Select the TCRSSLIOHandler component and set the Storage property to the instance of TCRSsoFileStorage (CRSsoFileStorage1).
  19. The TCRSsoFileStorage component assigned to the Storage property in the TCRSSLIOHandler component in the Object Inspector.

  20. Select the TUniQuery component and set the Connection property to the instance of TUniConnection (UniConnection1).
  21. Double-click the TUniQuery component, enter a SQL query to be run against the Oracle database, and then click OK.
  22. A SQL query added to the TUniQuery component.

  23. Double-click the TButton component and add code to call the Open method on the TUniQuery component instance to activate the dataset when the button is clicked.
  24. A created OnClick event for the TButton component.

  25. Press F9 to compile and run the application.
  26. In the form that appears, click Button1 to run the query. Data appears in the grid.
  27. A form with a grid filled with data and a button.

Connect using SSL certificates and keys

If you want to use SSL certificates and keys instead of an Oracle wallet, follow the steps in the previous section with the following modifications:

© 1997-2025 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback