Oracle APEX: How to Call External HTTPS APIs with Oracle Wallet & Certificates – Step-by-Step Guide
As an Oracle APEX developer, you will eventually need to connect your database securely to external HTTPS APIs. This tutorial walks you through the entire process: from configuring the Oracle wallet and importing SSL certificates, to setting up network access and testing the connection. By the end, you’ll have a robust, reusable solution you can apply to any HTTPS endpoint!
1. Why Do You Need an Oracle Wallet?
Oracle databases cannot call HTTPS endpoints out-of-the-box unless the target certificate is stored in the Oracle wallet. The wallet acts as the database’s certificate store. Without the right certificate, you’ll get connection errors when trying to access secure APIs.
2. Preparation: Certificate & Access
- Obtain the SSL certificate (
crt.crt) from your target API. - Ensure you have access to your Oracle database’s wallet directory (for example, via Docker).
3. Create Wallet Directory & Import Certificate
First, create a new folder for your API in the wallet directory and copy the certificate file into it:
Automated Script for Wallet Creation & Certificate Import
Use this shell script to initialize the wallet and import the certificate (adjust path and password as needed):
4. Set Network ACL (Access Control List)
The database needs explicit permission to access external hosts. Use the following PL/SQL to grant access (adjust the host and user as needed):
5. Store Connection Parameters in the Database
Save the endpoint and wallet details as global parameters for easy reuse:
6. Test: Make an HTTPS Request from the Database
Use this PL/SQL block to verify everything works:
Example output:
Conclusion
With these steps, you as an Oracle APEX developer can securely and reliably call any external HTTPS API from your database. This approach is reusable for any API and certificate.
- Try it now: Follow these steps in your own Oracle APEX project and test your API integration!
- Questions or feedback? Share your experience or ask questions in the comments!
- More APEX tips: Subscribe to the blog for more Oracle APEX best practices and deep dives!
{fullWidth}
